/* Mdar Premium Redesign - v1.4.4 Modern Royal Aesthetic */
:root {
    --mdar-primary: #1e1b4b;
    /* Deep Indigo Night */
    --mdar-secondary: #4f46e5;
    /* Vibrant Indigo */
    --mdar-accent: #f59e0b;
    /* Golden Amber */
    --mdar-bg: #f8fafc;
    --mdar-card-bg: #ffffff;
    --mdar-text: #0f172a;
    --mdar-text-muted: #64748b;
    --mdar-border: #e2e8f0;
    --mdar-success: #10b981;
    --mdar-error: #ef4444;
    --mdar-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --mdar-radius: 16px;
}

body {
    background-color: var(--mdar-bg) !important;
    color: var(--mdar-text);
    font-family: 'Outfit', 'Inter', 'Almarai', sans-serif;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Premium Form Container */
.mdar-form-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 0;
    background: var(--mdar-card-bg);
    border-radius: var(--mdar-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid var(--mdar-border);
}

.mdar-form-header {
    background: var(--mdar-primary);
    padding: 40px 30px;
    color: #fff;
    text-align: center;
}

.mdar-form-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.mdar-form-body {
    padding: 30px;
}

/* Redesigned Search Bar v1.4.4 */
.mdar-search-container {
    background: transparent;
    max-width: 1000px;
    margin: -50px auto 40px;
    padding: 0 15px;
    position: relative;
    z-index: 100;
}

.mdar-category-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.mdar-filter-card {
    background: #fff !important;
    color: var(--mdar-text) !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    border: 1px solid var(--mdar-border) !important;
    box-shadow: var(--mdar-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 14px;
}

.mdar-category-radio:checked~.mdar-filter-card {
    background: var(--mdar-secondary) !important;
    color: #fff !important;
    border-color: var(--mdar-secondary) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.mdar-filter-bar {
    background: #fff;
    padding: 8px;
    border-radius: 20px;
    display: flex;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid #fff;
    gap: 0;
}

.mdar-filter-item {
    flex: 1;
    border-left: 1px solid var(--mdar-border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mdar-filter-item:last-of-type {
    border-left: none;
}

.mdar-filter-item i {
    color: var(--mdar-secondary);
    font-size: 20px;
}

.mdar-filter-item input {
    border: none !important;
    background: transparent !important;
    font-weight: 500;
    color: var(--mdar-text);
    width: 100%;
}

.mdar-search-btn {
    background: var(--mdar-secondary) !important;
    color: #fff !important;
    border-radius: 14px !important;
    padding: 0 40px !important;
    font-size: 16px;
    font-weight: 700;
    margin: 4px;
    transition: all 0.2s;
}

.mdar-search-btn:hover {
    background: var(--mdar-primary) !important;
    transform: scale(1.02);
}

.mdar-search-btn:hover {
    background: #0056b3 !important;
}


/* Registration & Login Styling v1.4.3 */
.mdar-auth-container {
    max-width: 450px;
    margin: 40px auto;
    padding: 35px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

.mdar-auth-form h3 {
    margin-top: 0;
    color: var(--mdar-primary);
    font-weight: 700;
}

.mdar-auth-form .form-group label {
    font-size: 14px;
    color: #444;
}

.mdar-auth-form input[type="text"],
.mdar-auth-form input[type="email"],
.mdar-auth-form input[type="password"] {
    transition: all 0.2s ease;
}

.mdar-auth-form input:focus {
    border-color: var(--mdar-secondary) !important;
    box-shadow: 0 0 0 3px rgba(0, 108, 228, 0.1) !important;
    outline: none;
}

.form-message {
    padding: 12px;
    font-size: 14px;
    display: none;
}

.form-message.success {
    background: #e7f8e7;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.form-message.error {
    background: #fdeaea;
    color: #c62828;
    border: 1px solid #f9bdbb;
}

.mdar-submit-btn:active {
    transform: translateY(1px);
}

/* Base custom switch styles */
.mdar-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.mdar-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mdar-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.mdar-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked+.mdar-slider {
    background-color: var(--mdar-rotana-green);
}

input:checked+.mdar-slider:before {
    transform: translateX(20px);
}

.mdar-slider.round {
    border-radius: 20px;
}

.mdar-slider.round:before {
    border-radius: 50%;
}

/* Modern Card & Grid Redesign v1.4.4 */
.mdar-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.mdar-card {
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--mdar-border);
    position: relative;
    display: flex;
    flex-direction: column;
}

.mdar-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--mdar-secondary);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mdar-card:hover .card-image img {
    transform: scale(1.1);
}

.mdar-price-tag-v2 {
    background: linear-gradient(135deg, var(--mdar-secondary), var(--mdar-primary));
    color: #fff !important;
    padding: 6px 18px;
    border-radius: 12px;
    font-weight: 800;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    font-size: 0.9rem;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mdar-primary);
    margin: 10px 0;
    line-height: 1.4;
}

.mdar-spec-item {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.card-footer-meta {
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    color: #64748b;
    font-size: 13px;
}

.mdar-category-radio {
    display: none;
}

.mdar-category-radio:checked+.mdar-icon-svg {
    transform: scale(1.2);
    filter: brightness(1.3);
}

.mdar-category-radio:checked~span {
    font-weight: bold;
    color: #002366;
}

/* Smart Cards System V1.2.9 & Royal Blue Task 5 */
.mdar-category-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    width: 100%;
}

.mdar-filter-card {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1 / 1;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.mdar-filter-card span {
    font-family: 'Almarai', sans-serif;
}

.mdar-filter-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Booking Grid Facilities Style v1.3.3 */
.mdar-ad-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 25px;
    padding: 20px 0;
    border-top: 1px solid var(--mdar-border);
}

.mdar-amenity-header {
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    color: var(--mdar-primary);
    margin-bottom: 15px;
}

.mdar-amenity-badge {
    background: transparent !important;
    color: var(--mdar-text) !important;
    padding: 0 !important;
    font-size: 15px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: none !important;
    flex: 0 0 calc(33.33% - 20px);
    /* 3 columns like Booking */
    min-width: 150px;
}

.mdar-amenity-badge span svg {
    color: #008009;
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

/* Time Slot Styling v1.4.2 */
.slot-btn {
    padding: 10px;
    border: 1px solid #e7e7e7;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
}

.slot-btn:hover:not(.booked) {
    border-color: var(--mdar-secondary);
    color: var(--mdar-secondary);
    background: rgba(0, 108, 228, 0.04);
}

.slot-btn.selected {
    background: var(--mdar-secondary) !important;
    color: #fff !important;
    border-color: var(--mdar-secondary) !important;
}

.slot-btn.booked {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Booking Calendar Style Polish */
.mdar-booking-box {
    background: #fff;
    border: 1px solid #e7e7e7 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px !important;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f2f2f2;
}

.calendar-header h4 {
    color: #262626;
    font-weight: 700;
    font-size: 16px;
    margin: 0;
}

.calendar-nav-btn {
    background: transparent !important;
    border: none !important;
    color: #006ce4 !important;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.2s;
}

.calendar-nav-btn:hover {
    background: #f0f6ff !important;
}

#calendarGrid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: 0.2s;
    font-weight: 500;
}

.calendar-day.available {
    color: #262626;
}

.calendar-day.available:hover {
    background-color: #f0f6ff !important;
    color: #006ce4 !important;
}

.calendar-day.booked {
    color: #ced4da;
    text-decoration: line-through;
    cursor: not-allowed;
    background: #fdfdfd;
}

.calendar-day.selected {
    background-color: var(--mdar-secondary) !important;
    color: #fff !important;
    border-radius: 8px;
}


.mdar-btn-royal,
.btn-primary-outline,
.mdar-submit-btn {
    background: var(--mdar-secondary) !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #fff !important;
    cursor: pointer;
}

.mdar-btn-royal:hover,
.mdar-submit-btn:hover {
    background: var(--mdar-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

/* Amenity Item Toggles Polish */
.amenity-item:has(input:checked) {
    background: var(--mdar-secondary) !important;
    border-color: var(--mdar-secondary) !important;
}

.amenity-item:has(input:checked) i,
.amenity-item:has(input:checked) span {
    color: #fff !important;
}

.amenity-item:hover {
    border-color: var(--mdar-secondary) !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}


@media (max-width: 400px) {
    .mdar-category-selector {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .mdar-filter-card {
        transform: scale(0.95);
        max-width: 100%;
    }
}

/* Royal Blue buttons overrides */
button,
input[type="submit"],
.mdar-btn-primary,
.mdar-btn-royal,
.mdar-btn-secondary,
.auth-submit-btn,
.mdar-auth-btn {
    background-color: #001a4d !important;
    color: #ffffff !important;
    border-color: #001a4d !important;
}

button:hover,
input[type="submit"]:hover,
.mdar-btn-primary:hover,
.mdar-btn-royal:hover,
.auth-submit-btn:hover {
    background-color: #000f33 !important;
}


.mdar-filter-card:hover .mdar-svg-body {
    fill: #002366 !important;
}

.mdar-filter-card:hover .mdar-svg-primary {
    fill: #002366 !important;
}

@media (max-width: 400px) {
    .mdar-filter-card {
        transform: scale(0.85);
    }
}