/* ============================================
   Modern Color Scheme & Variables
   ============================================ */
:root {
    --primary-color: #A6BBa7;
    --primary-dark: #8AA68B;
    --secondary-color: #D4E3D5;
    /* Bootstrap primary overrides */
    --bs-primary: #A6BBa7;
    --bs-primary-rgb: 166, 187, 167;
    --bs-link-color: #8AA68B;
    --bs-link-hover-color: #6E8F6F;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-fast: all 0.2s ease-in-out;
    --transition-normal: all 0.3s ease-in-out;
}

/* ============================================
   Global Styles & Body Setup
   ============================================ */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--light-bg);
    width: 100%;
    box-sizing: border-box;
}

#app {
    min-height: 100vh;
    position: relative;
    width: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ============================================
   Social Login Styles
   ============================================ */
.hr-text {
    line-height: 1em;
    position: relative;
    outline: 0;
    border: 0;
    color: var(--text-secondary);
    text-align: center;
    height: 1.5em;
    opacity: 0.7;
}

.hr-text:before {
    content: '';
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
}

.hr-text:after {
    content: attr(data-content);
    position: relative;
    display: inline-block;
    color: var(--text-secondary);
    padding: 0 0.75em;
    line-height: 1.5em;
    background-color: white;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Social Login Button Styles */
.btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    transition: var(--transition-fast);
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-dark {
    border-color: var(--dark-bg);
    color: var(--dark-bg);
    transition: var(--transition-fast);
}

.btn-outline-dark:hover {
    background-color: var(--dark-bg);
    border-color: var(--dark-bg);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Button Enhancements
   ============================================ */
.btn {
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: var(--transition-fast);
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn svg {
    vertical-align: middle;
    transition: var(--transition-fast);
}

.btn:hover svg {
    transform: scale(1.1);
}

/* ============================================
   Card Styling
   ============================================ */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    overflow: hidden;
    background: white;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   Form Improvements
   ============================================ */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: 0;
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ============================================
   Badge Enhancements
   ============================================ */
.badge {
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.025em;
}

.bg-success {
    background: linear-gradient(135deg, var(--success-color), #059669) !important;
}

.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706) !important;
}

/* ============================================
   Alert Enhancements
   ============================================ */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-heading {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Validation message styling */
.validation-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.validation-summary-errors {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border-left: 4px solid var(--danger-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.validation-summary-errors li {
    color: var(--danger-color);
}

/* ============================================
   Loading Animations
   ============================================ */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

#app > div {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* ============================================
   Navigation Enhancements
   ============================================ */
.nav-menu {
    background: transparent;
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}

.nav-menu nav {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
    transition: var(--transition-fast);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* ============================================
   Layout Enhancements
   ============================================ */
.page {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--dark-bg), #0f172a);
    box-shadow: var(--shadow-xl);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1050;
    transition: transform var(--transition-normal);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

main {
    flex: 1;
    margin-left: 260px;
    background-color: var(--light-bg);
    transition: margin-left var(--transition-normal);
    width: calc(100% - 260px);
    min-height: 100vh;
    position: relative;
}

main.sidebar-collapsed {
    margin-left: 0;
    width: 100%;
}

.top-row {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-row h1 {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-size: 1.75rem;
}

.content {
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
    overflow: hidden;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    pointer-events: none;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

.hero-section .btn {
    position: relative;
    z-index: 1;
    margin: 0.25rem;
}

/* ============================================
   Responsive Improvements
   ============================================ */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
        position: fixed;
        top: 0;
        left: 0;
    }

    .sidebar-toggle {
        display: none;
    }

    .top-row {
        display: none !important;
    }

    main {
        margin-left: 260px !important;
        width: calc(100% - 260px) !important;
    }

    .page {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .sidebar-overlay.show {
        display: block;
    }

    main {
        margin-left: 0;
        width: 100%;
    }

    .top-row {
        padding: 1rem;
    }

    .top-row h1 {
        font-size: 1.5rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .content {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Fix button groups on mobile */
    .d-flex.gap-3.justify-content-center {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .d-flex.gap-3.justify-content-center .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .col-md-6, .col-md-4 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    
    .card {
        margin: 0.5rem 0;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .hero-section {
        padding: 1.5rem 0.75rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .content {
        padding: 0.75rem;
    }

    /* Improve navigation on small screens */
    .nav-link {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Fix card layout on small screens */
    .row.g-4 {
        margin: 0;
        row-gap: 1rem;
    }

    .row.g-4 > * {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .alert, .btn {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   Utility Classes
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.shadow-hover {
    transition: var(--transition-normal);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* Fix common Bootstrap grid issues */
.row {
    margin-left: 0;
    margin-right: 0;
}

.row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Improve spacing consistency */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Better button group spacing */
.d-flex.gap-3 {
    gap: 1rem !important;
}

.d-grid.gap-2 {
    gap: 0.5rem !important;
}

/* Improve text readability */
.lead {
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 400;
}

/* Fix overflow issues */
.container-fluid {
    overflow-x: hidden;
}

/* Ensure proper card heights */
.h-100 {
    height: 100% !important;
}

/* Better spacing for navigation items */
.nav-item {
    margin-bottom: 0.25rem;
}

/* =========================================================
   Week View — Cleaning Sessions
   ========================================================= */

.week-view-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 5 weekdays + 1 weekend column by default */
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
}

/* When weekend is visible, show all 7 columns */
.week-view-grid:has(.week-day-col:nth-child(7):not(.week-day-col--weekend-collapsed)) {
    grid-template-columns: repeat(7, 1fr);
}

.week-day-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.week-day-col--weekend-collapsed {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
    min-height: 80px;
}

.week-day-col--weekend-collapsed:hover {
    opacity: 1;
}

.week-day-col--today .week-day-header {
    border-bottom-color: var(--bs-primary);
}

.week-day-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--bs-border-color);
    margin-bottom: 4px;
    min-height: 2rem;
}

.week-day-header--today {
    border-bottom-color: var(--bs-primary) !important;
}

.week-day-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
}

.week-day-date {
    font-size: 1rem;
    font-weight: 500;
    min-width: 24px;
}

.week-day-col--today .week-day-date {
    color: var(--bs-primary);
    font-weight: 700;
}

.week-day-count {
    font-size: 0.7rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: auto;
}

.week-day-alert {
    font-size: 0.75rem;
}

.week-day-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.week-day-empty {
    color: var(--bs-border-color);
    font-size: 1rem;
    text-align: center;
    padding: 12px 0;
}

/* Compact clean card */
.clean-card {
    border-left: 3px solid var(--bs-secondary);
    background: var(--bs-body-bg);
    border-radius: 0 6px 6px 0;
    padding: 7px 9px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    overflow: hidden;
}

.clean-card:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.clean-card--scheduled   { border-left-color: var(--bs-secondary); }
.clean-card--inprogress  { border-left-color: var(--bs-primary); }
.clean-card--validation  { border-left-color: var(--bs-warning); }
.clean-card--validated   { border-left-color: var(--bs-success); }
.clean-card--cancelled   { border-left-color: var(--bs-danger); opacity: 0.6; }

.clean-card-time {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.clean-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
}

.clean-card-status {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1.2;
    flex-shrink: 0;
}

.clean-card-status--scheduled   { color: var(--bs-secondary-color); }
.clean-card-status--inprogress  { color: var(--bs-primary); }
.clean-card-status--validation  { color: var(--bs-warning-text-emphasis, #997404); }
.clean-card-status--validated   { color: var(--bs-success); }
.clean-card-status--cancelled   { color: var(--bs-danger); }

.clean-card-name {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2px;
}

.clean-card-address {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    line-height: 1.2;
    margin-top: 1px;
}

.clean-card-progress {
    height: 3px;
    background: var(--bs-secondary-bg);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.clean-card-progress-bar {
    height: 100%;
    background: var(--bs-success);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.clean-card-rooms {
    font-size: 0.65rem;
    color: var(--bs-secondary-color);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .week-view-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
