/* Apartman Rezervacije - Public CSS */

#apartman-rezervacije-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.apartman-intro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #007cba;
}

/* Apartman Info Header */
.apartman-info-header {
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4fd 100%);
    border: 2px solid #007cba;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
}

.apartman-title h2 {
    color: #007cba;
    font-size: 24px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.apartman-title h2 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.apartman-address {
    color: #666;
    font-size: 16px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apartman-address .dashicons {
    color: #007cba;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.address-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.address-link:hover {
    color: #007cba;
    text-decoration: underline;
}

.apartman-contact h3 {
    color: #333;
    font-size: 18px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apartman-contact h3 .dashicons {
    color: #007cba;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.contact-info {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 12px 0;
    color: #555;
}

.phone-link, .email-link {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

.phone-link:hover, .email-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.contact-apps {
    margin: 0 0 15px 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25D366;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.app-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

.app-badge.viber {
    background: #665CAC;
}

.app-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.reservation-instruction {
    background: #fff;
    border: 2px solid #007cba;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
    color: #007cba;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reservation-instruction .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Social Media Section */
.apartman-social {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.apartman-social h4 {
    color: #333;
    font-size: 16px;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apartman-social h4 .dashicons {
    color: #007cba;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.social-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.social-link.youtube {
    background: #FF0000;
}

.social-link.facebook {
    background: #1877F2;
}

.social-link.instagram {
    background: linear-gradient(45deg, #F56040, #E1306C, #C13584, #833AB4);
}

.social-link.google {
    background: #4285F4;
}

@media (max-width: 768px) {
    .apartman-info-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .apartman-title h2 {
        font-size: 20px;
    }
    
    .apartman-address, .contact-info {
        font-size: 14px;
    }
    
    .apartman-contact h3 {
        font-size: 16px;
    }
    
    .reservation-instruction {
        font-size: 14px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .contact-apps {
        justify-content: center;
    }
    
    .apartman-social h4 {
        font-size: 14px;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
        gap: 8px;
    }
    
    .social-link {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Instructions */
.calendar-instructions {
    background: #e8f4fd;
    border: 1px solid #007cba;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
}

.calendar-instructions p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-instructions .dashicons {
    color: #007cba;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Calendar Styles */
#apartman-calendar-container {
    margin-bottom: 30px;
    overflow-x: visible;
}

.apartman-calendar-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.apartman-calendar-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.apartman-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.calendar-month {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.calendar-header {
    background: #007cba;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
}

.day-header {
    padding: 10px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    color: #666;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 240px;
}

.calendar-day {
    border: 1px solid #eee;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    min-height: 40px;
    position: relative;
    background: #fff;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: #f0f0f0;
}

.calendar-day.other-month {
    color: #ccc;
    background: #fafafa;
}

.calendar-day.available {
    background: #e8f5e8;
    color: #333;
}

.calendar-day.reserved {
    background: #1e3a8a;
    color: white;
    cursor: not-allowed;
}

.calendar-day.on-hold {
    background: #60a5fa;
    color: white;
    cursor: not-allowed;
}

.calendar-day.past {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.calendar-day.selected {
    border: 3px solid #007cba;
    box-shadow: 0 0 0 1px #007cba inset;
}

/* For regular available days - full background */
.calendar-day.selected.available {
    background: #007cba;
    color: white;
}

/* For changeover days - keep the gradient but add selection indicator */
.calendar-day.selected.departure-only.reserved {
    background: linear-gradient(to bottom right, #1e3a8a 50%, #007cba 50%);
}

.calendar-day.selected.arrival-only.reserved {
    background: linear-gradient(to bottom right, #007cba 50%, #1e3a8a 50%);
}

.calendar-day.selected.departure-only.on-hold {
    background: linear-gradient(to bottom right, #60a5fa 50%, #007cba 50%);
}

.calendar-day.selected.arrival-only.on-hold {
    background: linear-gradient(to bottom right, #007cba 50%, #60a5fa 50%);
}

.calendar-day.in-range {
    background: #b3d9ff;
    color: #333;
}

/* Departure and arrival days styling */
.calendar-day.departure-only.reserved {
    position: relative;
    background: linear-gradient(to bottom right, #1e3a8a 50%, #e8f5e8 50%);
    cursor: pointer;
}

.calendar-day.arrival-only.reserved {
    position: relative;
    background: linear-gradient(to bottom right, #e8f5e8 50%, #1e3a8a 50%);
    cursor: pointer;
}

.calendar-day.changeover.reserved {
    position: relative;
    background: linear-gradient(to bottom right, #1e3a8a 50%, #1e3a8a 50%);
    cursor: default;
}

/* On-hold variations */
.calendar-day.departure-only.on-hold {
    position: relative;
    background: linear-gradient(to bottom right, #60a5fa 50%, #e8f5e8 50%);
    cursor: pointer;
}

.calendar-day.arrival-only.on-hold {
    position: relative;
    background: linear-gradient(to bottom right, #e8f5e8 50%, #60a5fa 50%);
    cursor: pointer;
}

.calendar-day.changeover.on-hold {
    position: relative;
    background: linear-gradient(to bottom right, #60a5fa 50%, #60a5fa 50%);
    cursor: default;
}

/* Diagonal line for changeover indication */
.calendar-day.departure-only:after,
.calendar-day.arrival-only:after,
.calendar-day.changeover:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom right, transparent 48%, #fff 48%, #fff 52%, transparent 52%);
    pointer-events: none;
}

.day-price {
    font-size: 10px;
    color: #666;
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
}

.calendar-day.reserved .day-price,
.calendar-day.on-hold .day-price {
    color: rgba(255, 255, 255, 0.8);
}

/* Legend */
.apartman-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.legend-color.available {
    background: #e8f5e8;
}

.legend-color.reserved {
    background: #1e3a8a;
}

.legend-color.on-hold {
    background: #60a5fa;
}

.legend-text {
    font-size: 14px;
    color: #333;
}

/* Form Styles */
#apartman-reservation-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-top: 30px;
    width: 100%;
    box-sizing: border-box;
    display: block; /* Forma uvijek vidljiva */
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    color: #333;
}

.selected-dates {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.selected-dates p {
    margin: 5px 0;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.form-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #005a87;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
#apartman-message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

#apartman-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#apartman-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Mobile scroll indicator */
.calendar-scroll-indicator {
    display: none;
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

/* Desktop - ensure full width */
@media (min-width: 1200px) {
    #apartman-rezervacije-wrapper {
        max-width: 1400px;
        padding: 30px;
    }
    
    .apartman-calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet */
@media (max-width: 1199px) and (min-width: 769px) {
    #apartman-calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .apartman-calendar-grid {
        min-width: 1100px;
        grid-template-columns: repeat(4, minmax(260px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    #apartman-rezervacije-wrapper {
        padding: 5px;
        margin: 0;
        width: 100vw;
        max-width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }
    
    .calendar-scroll-indicator {
        display: block;
    }
    
    #apartman-calendar-container {
        position: relative;
        padding-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #apartman-calendar-container:after {
        content: '→';
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 24px;
        color: #007cba;
        animation: slide 1s ease-in-out infinite;
    }
    
    @keyframes slide {
        0%, 100% { transform: translateY(-50%) translateX(0); }
        50% { transform: translateY(-50%) translateX(5px); }
    }
    
    .apartman-calendar-grid {
        min-width: 800px;
        gap: 10px;
    }
    
    .calendar-month {
        min-width: 190px;
    }
    
    .calendar-header {
        padding: 10px;
        font-size: 14px;
    }
    
    .calendar-day {
        padding: 6px 2px;
        min-height: 35px;
        font-size: 12px;
    }
    
    .day-price {
        font-size: 9px;
    }
    
    .apartman-calendar-legend {
        gap: 10px;
        font-size: 12px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 0;
    }
    
    .legend-item {
        flex-shrink: 0;
    }
    
    #apartman-reservation-form {
        padding: 15px 10px;
        margin: 20px 0 0 0;
        border-radius: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-section h3 {
        font-size: 18px;
    }
    
    .selected-dates {
        padding: 15px;
    }
    
    .selected-dates p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .apartman-calendar-grid {
        min-width: 720px;
    }
    
    .calendar-month {
        min-width: 170px;
    }
    
    .calendar-day {
        padding: 4px 1px;
        min-height: 30px;
        font-size: 11px;
    }
    
    .day-header {
        font-size: 10px;
        padding: 8px 2px;
    }
    
    #apartman-rezervacije-wrapper {
        padding: 2px;
    }
    
    #apartman-reservation-form {
        padding: 10px 5px;
        border-radius: 0;
    }
    
    .btn {
        width: 100%;
        padding: 14px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 8px;
    }
}

/* Modal Styles */
.apartman-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.apartman-modal-content {
    background-color: #fff;
    margin: 5% auto;
    position: relative;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    border: 2px solid #007cba;
    z-index: 1000000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: fixed;
}

@keyframes slideIn {
    from { transform: translate(-50%, -60%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.apartman-modal-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4fd 100%);
    border-radius: 12px 12px 0 0;
}

.apartman-modal-header h3 {
    margin: 0;
    color: #007cba;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.apartman-modal-header h3:before {
    content: "⚠️";
    font-size: 24px;
}

.apartman-modal-body {
    padding: 25px;
    color: #444;
    line-height: 1.6;
    font-size: 16px;
    text-align: center;
}

.apartman-modal-footer {
    padding: 15px 25px 25px 25px;
    text-align: center;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.apartman-modal-footer .btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
    text-align: center;
}

.apartman-modal-footer .btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.apartman-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.apartman-modal-close:hover,
.apartman-modal-close:focus {
    color: #007cba;
    background: rgba(0, 124, 186, 0.1);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .apartman-modal-content {
        width: 95%;
        max-width: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .apartman-modal-header {
        padding: 18px;
    }
    
    .apartman-modal-header h3 {
        font-size: 18px;
    }
    
    .apartman-modal-body {
        padding: 20px 18px;
        font-size: 15px;
    }
    
    .apartman-modal-footer {
        padding: 15px 18px 20px 18px;
    }
    
    .apartman-modal-footer .btn {
        padding: 10px 25px;
        font-size: 15px;
        min-width: 100px;
    }
    
    .apartman-modal-close {
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 24px;
    }
}

/* Force modal to work properly */
#min-nights-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.6);
    display: none;
}

#min-nights-modal.show,
#min-nights-modal[style*="block"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

#min-nights-modal .apartman-modal-content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 0;
}

/* Language Switcher Styles */
.apartman-language-switcher-container {
    text-align: right;
    margin-bottom: 20px;
}

.apartman-language-switcher-flags {
    display: inline-flex;
    gap: 15px;
    align-items: center;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.apartman-lang-flag {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #666;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.apartman-lang-flag:hover {
    background: #e8f4fd;
    color: #007cba;
    text-decoration: none;
}

.apartman-lang-flag.active {
    background: #007cba;
    color: white;
}

.apartman-lang-flag .flag {
    font-size: 20px;
    line-height: 1;
}

.apartman-lang-flag .name {
    font-weight: 500;
}

/* Language Dropdown Style */
.apartman-language-switcher {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.apartman-language-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.apartman-language-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

@media (max-width: 768px) {
    .apartman-language-switcher-container {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .apartman-language-switcher-flags {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .apartman-lang-flag {
        font-size: 13px;
        padding: 4px 8px;
    }
}

/* Thank you message */
.apartman-thank-you-message {
    background: #f0f8ff;
    border: 2px solid #007cba;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.apartman-thank-you-message h2 {
    color: #007cba;
    margin-bottom: 20px;
}

.apartman-thank-you-message p {
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.apartman-thank-you-message ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.apartman-thank-you-message li {
    margin: 10px 0;
    font-size: 16px;
}

.apartman-thank-you-message .button {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background 0.3s;
}

.apartman-thank-you-message .button:hover {
    background: #005a87;
    color: white;
}