/* MoraBookAI — mobile-first global overrides */

/* -------------------------------------------------
   Base mobile-first resets
   ------------------------------------------------- */
* { -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

@media (max-width: 480px) {
    html { font-size: 15px; }
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

img {
    max-width: 100%;
    height: auto;
}

/* -------------------------------------------------
   Admin base.html overrides
   ------------------------------------------------- */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 1.25rem;
    background: linear-gradient(135deg, #2d2a32 0%, #1f1d24 100%);
    color: white;
    z-index: 1100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.mobile-header .brand { font-size: 1.25rem; }

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-header { display: flex !important; }
    .sidebar {
        transform: translateX(-100%);
        top: 64px;
        width: 280px;
        max-width: 85vw;
        background: #2d2a32;
        z-index: 1050;
        padding: 1.5rem 1rem;
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    }
    .sidebar.open { transform: translateX(0); }
    .main {
        margin-left: 0 !important;
        padding: 5rem 1rem 2rem !important;
        min-height: 100vh;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .page-header h1 { font-size: 1.45rem !important; }
    .page-header .btn,
    .page-header .btn-secondary,
    .page-header .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .card { border-radius: 14px; }
    .card-header,
    .card-body { padding: 1rem; }
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .form-actions .btn,
    .form-actions .btn-secondary,
    .form-actions .btn-primary,
    .form-actions .btn-danger {
        width: 100%;
        justify-content: center;
    }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tbody tr {
        margin-bottom: 1rem;
        border: 1px solid var(--pearl);
        border-radius: 12px;
        padding: 0.75rem;
        background: white;
    }
    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--rose-100);
        text-align: right !important;
    }
    tbody td:last-child { border-bottom: none; }
    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--graphite);
        margin-right: 1rem;
    }
    .stats-grid,
    .dashboard-stats,
    .insights-grid,
    .report-grid {
        grid-template-columns: 1fr !important;
    }
    .calendar-table td,
    .calendar-table th {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
    .calendar-day { min-height: 60px; }
}

@media (max-width: 480px) {
    .main { padding: 4.5rem 0.75rem 1.5rem !important; }
    .page-header h1 { font-size: 1.3rem !important; }
    .card-header h2, .card-header h3 { font-size: 1rem !important; }
    .btn { padding: 0.75rem 1rem !important; font-size: 0.95rem !important; }
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 0.85rem !important; font-size: 1rem !important; }
}

/* -------------------------------------------------
   Auth pages (login, setup)
   ------------------------------------------------- */
@media (max-width: 768px) {
    .auth-page { padding: 1rem !important; }
    .auth-card {
        padding: 1.75rem !important;
        border-radius: 16px !important;
        max-width: 100% !important;
    }
    .auth-logo { font-size: 1.5rem !important; }
    .auth-card h1 { font-size: 1.35rem !important; }
}

/* -------------------------------------------------
   Public booking flow overrides
   ------------------------------------------------- */
@media (max-width: 768px) {
    .booking-page {
        grid-template-columns: 1fr !important;
        min-height: auto;
    }
    .hero-side {
        padding: 2rem 1.25rem !important;
        min-height: auto;
        order: 1;
    }
    .hero-title { font-size: 1.75rem !important; margin: 1.5rem 0 1rem !important; }
    .hero-subtitle { font-size: 0.95rem !important; }
    .hero-features { margin-top: 1.5rem !important; }
    .hero-footer { margin-top: 1.5rem !important; font-size: 0.75rem !important; }
    .form-side {
        padding: 1.5rem 1rem !important;
        order: 2;
        min-height: auto;
    }
    .form-container { max-width: 100% !important; }
    .stepper { margin-bottom: 1.5rem !important; }
    .step-dot {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }
    .service-option {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
        padding: 1rem !important;
    }
    .service-option .price { font-size: 1rem !important; align-self: flex-end; }
    .btn { padding: 0.95rem 1.25rem !important; font-size: 1rem !important; }
    .slot-grid,
    .slots-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .slot-grid,
    .slots-grid {
        grid-template-columns: 1fr !important;
    }
    .hero-title { font-size: 1.55rem !important; }
    .brand { font-size: 1.5rem !important; }
}

/* -------------------------------------------------
   Marketing homepage mobile overrides
   ------------------------------------------------- */
@media (max-width: 768px) {
    .hero-section,
    .hero { padding: 4rem 1rem !important; }
    .hero h1,
    .hero-title { font-size: 2rem !important; line-height: 1.2 !important; }
    .hero p,
    .hero-subtitle { font-size: 1rem !important; }
    .features-grid,
    .steps-grid,
    .testimonials-grid,
    .pricing-grid,
    .disciplines-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .feature-card,
    .step-card,
    .testimonial,
    .pricing-card {
        padding: 1.25rem !important;
    }
    nav.main-nav { display: none; }
    .mobile-nav { display: flex; }
    .cta-section { padding: 3rem 1rem !important; }
    .faq-item { padding: 1rem !important; }
    footer { padding: 2rem 1rem !important; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .comparison-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* -------------------------------------------------
   General accessibility / touch improvements
   ------------------------------------------------- */
button, .btn, a, input, select, textarea, .service-option, .slot-btn, .nav-item {
    touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--rose-300);
    outline-offset: 2px;
}
