:root {
    /* Palet Warna Baru: Lebih lembut dan profesional */
    --color-primary: #4b514d; /* Dark Grey yang Elegan */
    --color-secondary: #007bff; /* Biru Aksen untuk fokus */
    --color-text: #333333;
    --color-muted: #6c757d;
    --color-light-bg: #f8f9fa;
    --color-border: #e9ecef;
    --color-hover: #f1f1f1;
    --color-booked: #fcdbdc; /* Merah Muda Lembut */
    --color-booked-text: #c0392b; /* Merah Tua */
    
    /* Datepicker Variables (Diperbarui) */
    --dp-bg: #ffffff;
    --dp-text: var(--color-text);
    --dp-muted: var(--color-muted);
    --dp-border: var(--color-border);
    --dp-accent: var(--color-primary); /* Menggunakan warna primary baru */
    --dp-accent-contrast: #ffffff;
    --dp-hover: var(--color-light-bg);
    --dp-shadow: 0 25px 50px rgba(0,0,0,.15), 0 10px 20px rgba(0,0,0,.1);
    --radius: 16px;
    --radius-day: 10px;
    
    /* New Variables for Enhanced Design */
    --dp-gradient: linear-gradient(135deg, #383838 0%, #352626 100%);
    --dp-success: #10b981;
    --dp-warning: #f59e0b;
    --dp-high-season: #fbbf24;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

/* --- 1. Form Container dan Label (ENHANCED) --- */

.form-container {
    max-width: 90%;
    margin: 50px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    align-items: end;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.8);
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
    text-align: left;
    font-size: 15px;
    letter-spacing: -0.2px;
}

/* --- 2. Input Form Styling (ENHANCED) --- */

.date-input, .capacity-input {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid var(--color-border);
    border-radius: 12px;       
    font-size: 16px;
    text-align: left;
    color: var(--color-text);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
}

.date-input:focus, .capacity-input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(0,123,255,.15);
    background-color: #fff;
    transform: translateY(-2px);
}

.date-input::placeholder, .capacity-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* --- 3. Datepicker Styling (COMPLETELY REDESIGNED) --- */

.datepicker {
    position: absolute;
    z-index: 9999;
    width: min(95vw, 420px);
    background: var(--dp-bg);
    color: var(--dp-text);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--dp-shadow);
    padding: 0;
    display: none;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.datepicker.open {
    display: block;
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header dengan gradient */
.dp-header {
    background: var(--dp-gradient);
    color: white;
    padding: 20px 24px 16px;
    position: relative;
    display: flex;
    justify-content: center;
    gap: 15%;
}

.dp-nav-container {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dp-nav-btn {
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    font-size: 18px;
}

.dp-nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.dp-title {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    letter-spacing: -0.3px;
    margin-top: 5px;
}

.dp-selects {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.dp-selects select {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    font-size: 14px;
    color: white;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    cursor: pointer;
}

.dp-selects select:hover {
    background: rgba(255,255,255,0.25);
}

.dp-selects select option {
    background: white;
    color: var(--color-text);
}

/* Grid Container */
.dp-grid-container {
    padding: 20px 16px;
}

.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.dp-weekday {
    text-align: center;
    font-size: 13px;
    color: var(--dp-muted);
    font-weight: 600;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dp-weekday:nth-child(1) {
    color: #ef4444; /* Sunday */
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 0 4px;
}

.dp-day {
    border: 2px solid transparent;
    background: transparent;
    border-radius: var(--radius-day);
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}


/* Hover Effects */
.dp-day:not(.disabled):not(.booked):hover {
    background: var(--dp-hover);
    border-color: var(--color-border);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Selected Date */
.dp-day.selected {
    background: var(--dp-gradient);
    color: white;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

/* Disabled Dates */
.dp-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
    position: relative;
}

.dp-day.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: #d1d5db;
    transform: rotate(-45deg);
}

/* Booked Dates */
.dp-day.booked {
    background: linear-gradient(135deg, var(--color-booked) 0%, #f8d7da 100%);
    color: var(--color-booked-text);
    cursor: not-allowed;
    font-weight: 600;
    border: 2px solid #f5c6cb;
    position: relative;
}

.dp-day.booked::before {
    content: '✕';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    font-weight: bold;
}

/* Checkout Valid Dates */
.dp-day.checkout-valid {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    color: var(--color-secondary);
    font-weight: 700;
    border: 2px solid var(--color-secondary);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

/* Today's Date */
.dp-day.today {
    border: 2px solid var(--dp-warning);
    background: rgba(245, 158, 11, 0.1);
    font-weight: 700;
}

.dp-day.today::after {
    content: 'Hari Ini';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--dp-warning);
    white-space: nowrap;
}

/* High Season Dates */
.dp-day.high-season {
    background: linear-gradient(135deg, var(--dp-high-season) 0%, #fcd34d 100%);
    color: #92400e;
    font-weight: 600;
    position: relative;
}

.dp-day.high-season::before {
    content: '★';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
}

/* Footer dengan aksi */
.dp-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--dp-border);
}

.dp-footer button {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--dp-border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 14px;
    letter-spacing: -0.2px;
}

.dp-footer button:hover {
    background: var(--color-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.dp-footer .primary {
    background: var(--dp-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.dp-footer .primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* --- 4. Booking Bar Styling (ENHANCED) --- */

.booking-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.08);
    max-width: 1200px;
    margin: 60px auto;
    gap: 24px;
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.booking-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--dp-gradient);
}

.field {
    display: flex;
    flex-direction: column;
    min-width: 240px;
    flex-grow: 1;
    position: relative;
}

.field label {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-icon {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 20px;
    border: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.input-icon::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--dp-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.input-icon:hover::before {
    opacity: 1;
}

.input-icon:focus-within {
    background: white;
    border-color: var(--color-secondary);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-2px);
}

.input-icon i {
    margin-right: 12px;
    color: var(--color-primary);
    font-size: 20px;
    transition: all 0.3s;
}

.input-icon:focus-within i {
    color: var(--color-secondary);
    transform: scale(1.1);
}

.input-icon input {
    border: none;
    outline: none;
    font-size: 17px;
    width: 100%;
    padding: 0;
    background: transparent;
    color: var(--color-text);
    font-weight: 600;
    letter-spacing: -0.2px;
}

.input-icon input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--color-border), transparent);
    height: 60px;
    flex-shrink: 0;
}

.search-button {
    padding: 18px 36px;
    background: var(--dp-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.search-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-3px);
}

.search-button:hover::before {
    left: 100%;
}

/* --- 5. Enhanced Datepicker Legend --- */

.dp-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 24px;
    border-top: 1px solid var(--dp-border);
    background: #f8fafc;
    margin-top: 0;
}

.dp-legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--dp-muted);
    font-weight: 500;
    padding: 6px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--dp-border);
    transition: all 0.2s;
}

.dp-legend-item:hover {
    background: var(--dp-hover);
    transform: translateY(-1px);
}

.dp-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
    border: 2px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.dp-legend-color.booked {
    background: var(--color-booked);
    border-color: var(--color-booked-text);
}

.dp-legend-color.high-season {
    background: var(--dp-high-season);
    border-color: #d97706;
}

.dp-legend-color.today {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--dp-warning);
}

.dp-legend-color.selected {
    background: var(--dp-gradient);
    border-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 20px;
        margin: 30px auto;
    }
    
    .booking-bar {
        flex-direction: column;
        gap: 20px;
        padding: 30px 24px;
        margin: 40px 20px;
    }
    
    .field {
        min-width: auto;
        width: 100%;
    }
    
    .divider {
        width: 100%;
        height: 1px;
        background: var(--color-border);
    }
    
    .dp-legend {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    
    .datepicker {
        width: 95vw;
        left: 2.5vw !important;
        right: 2.5vw !important;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Success State */
.success {
    border-color: var(--dp-success) !important;
    background: rgba(16, 185, 129, 0.05) !important;
}