/**
 * Mobile Responsive CSS for OrchestraReady
 * Comprehensive mobile-first responsive styles for all pages
 */

/* ==========================================================================
   BASE MOBILE STYLES
   ========================================================================== */

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

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Better touch targets - minimum 44px for accessibility */
button,
a,
input[type="checkbox"],
input[type="radio"],
.btn,
.clickable {
    min-height: 44px;
    min-width: 44px;
}

/* Improve text readability on mobile */
body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ==========================================================================
   MOBILE CONTAINER & PADDING
   ========================================================================== */

@media (max-width: 767px) {
    /* Main content area - reduce padding */
    .flex-1.overflow-auto > .px-4.py-6 {
        padding: 0.75rem !important;
        padding-top: 3.5rem !important; /* Space for hamburger button */
    }

    /* Container should be full width on mobile */
    .flex-1.overflow-auto .container {
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Remove content-card wrapper styling on mobile for full width */
    .flex-1.overflow-auto .container.content-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    /* Reduce padding on mobile */
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .py-6 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Content cards need less padding on mobile */
    .content-card:not(.container) {
        padding: 1rem !important;
        border-radius: 0.5rem;
    }

    .p-6 {
        padding: 1rem !important;
    }

    .p-4 {
        padding: 0.75rem !important;
    }

    /* Gap adjustments */
    .gap-6 {
        gap: 0.75rem !important;
    }

    .gap-4 {
        gap: 0.5rem !important;
    }

    /* Margin adjustments */
    .mb-6 {
        margin-bottom: 1rem !important;
    }

    .mt-6 {
        margin-top: 1rem !important;
    }
}

/* ==========================================================================
   MOBILE NAVIGATION
   ========================================================================== */

/* Mobile sidebar z-index fix - CRITICAL for menu to work */
#mobileSidebar {
    z-index: 9999 !important;
}

#mobileSidebar #sidebarOverlay {
    z-index: 1 !important;
}

#mobileSidebar .sidebar-panel {
    z-index: 10 !important;
    pointer-events: auto !important;
}

/* Ensure menu items are clickable */
#mobileSidebar .sidebar-panel a,
#mobileSidebar .sidebar-panel button {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

/* Hamburger button improvements */
.corner-hamburger {
    width: 44px;
    height: 44px;
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile sidebar improvements */
@media (max-width: 1023px) {
    .mobile-sidebar {
        z-index: 200;
    }

    .mobile-sidebar .absolute {
        max-width: 85vw;
        width: 280px;
    }

    /* Make menu items more tappable */
    .mobile-sidebar a,
    .mobile-sidebar button {
        padding: 14px 16px !important;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* Improve menu scrolling */
    .mobile-sidebar .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* ==========================================================================
   MOBILE TYPOGRAPHY
   ========================================================================== */

@media (max-width: 767px) {
    /* Scale down headings on mobile */
    h1, .text-2xl {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    h2, .text-xl {
        font-size: 1.25rem !important;
        line-height: 1.35;
    }

    h3, .text-lg {
        font-size: 1.1rem !important;
    }

    /* Ensure readable body text */
    body, p, span, div {
        font-size: 0.9375rem;
        line-height: 1.5;
    }

    .text-sm {
        font-size: 0.8125rem !important;
    }

    .text-xs {
        font-size: 0.75rem !important;
    }
}

/* ==========================================================================
   MOBILE GRIDS
   ========================================================================== */

@media (max-width: 767px) {
    /* Force single column on mobile - except for home page action grid */
    .grid-cols-3,
    .md\:grid-cols-2,
    .md\:grid-cols-3,
    .lg\:grid-cols-2,
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Keep 2 columns for specific grids that need it */
    .home-main .action-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Reduce grid gaps on mobile */
    .gap-6 {
        gap: 1rem !important;
    }

    .gap-4 {
        gap: 0.75rem !important;
    }
}

/* ==========================================================================
   PRACTICE LISTS DASHBOARD - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .practice-lists-dashboard {
        padding: 0;
    }

    .practice-lists-dashboard .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .practice-lists-dashboard .dashboard-header h1 {
        margin-bottom: 0.5rem;
    }

    .practice-lists-dashboard .dashboard-header .actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .practice-lists-dashboard .dashboard-header .actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Practice list cards */
    .practice-lists-grid {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
    }

    .practice-list-card {
        padding: 1rem !important;
        margin-bottom: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .practice-list-card .list-card-header {
        flex-wrap: wrap;
    }

    .practice-list-card .list-title {
        font-size: 1rem !important;
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }

    .practice-list-card .list-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-top: 0.75rem;
    }

    .practice-list-card .meta-item {
        font-size: 0.75rem;
    }

    /* Type sections */
    .type-section {
        margin-bottom: 1.5rem;
    }

    .type-header h2 {
        font-size: 1.1rem !important;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .type-badge {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   LIST VIEW PAGE - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Table responsive wrapper */
    .overflow-x-auto {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide the standard table on mobile and show card layout */
    #excerpts-form table {
        display: none;
    }

    /* Add mobile card layout for excerpts */
    #excerpts-form .mobile-excerpt-cards {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
    }

    /* Mobile excerpt card */
    .mobile-excerpt-card {
        background: var(--color-card-bg);
        border: 1px solid var(--color-border-primary);
        border-left: 4px solid var(--color-primary-500);
        border-radius: 0.5rem;
        padding: 1rem;
    }

    .mobile-excerpt-card .excerpt-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }

    .mobile-excerpt-card .excerpt-title {
        font-weight: 600;
        color: var(--color-text-primary);
        font-size: 0.9375rem;
    }

    .mobile-excerpt-card .excerpt-subtitle {
        color: var(--color-text-secondary);
        font-size: 0.8125rem;
        margin-top: 0.25rem;
    }

    .mobile-excerpt-card .excerpt-details {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        font-size: 0.75rem;
        color: var(--color-text-tertiary);
    }

    .mobile-excerpt-card .excerpt-detail-item {
        display: flex;
        flex-direction: column;
    }

    .mobile-excerpt-card .excerpt-detail-label {
        font-weight: 500;
        text-transform: uppercase;
        font-size: 0.625rem;
        margin-bottom: 0.125rem;
    }

    .mobile-excerpt-card .excerpt-controls {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--color-border-primary);
    }

    .mobile-excerpt-card .control-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-excerpt-card .control-label {
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--color-text-secondary);
    }

    .mobile-excerpt-card .slider-container {
        flex: 1;
        max-width: 120px;
        margin-left: 0.75rem;
    }

    .mobile-excerpt-card .star-rating {
        margin-left: 0.75rem;
    }

    .mobile-excerpt-card .delete-btn {
        color: var(--color-error-text);
        font-size: 0.75rem;
        padding: 0.5rem;
        margin-top: 0.5rem;
        text-align: center;
        width: 100%;
        border-top: 1px solid var(--color-border-primary);
    }

    /* Standard table improvements for fallback */
    table {
        font-size: 0.8125rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.375rem !important;
        white-space: nowrap;
    }

    /* Make table horizontally scrollable */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Slider container in tables */
    .slider-container {
        min-width: 80px;
    }

    /* Star rating touch improvements */
    .star-rating label {
        font-size: 1.5rem !important;
        padding: 0.25rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Add excerpt form */
    .bg-white.rounded-lg form .grid {
        grid-template-columns: 1fr !important;
    }

    .bg-white.rounded-lg form input,
    .bg-white.rounded-lg form select,
    .bg-white.rounded-lg form textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    /* List info header - make responsive */
    .bg-white.dark\\:bg-gray-800.rounded-lg.shadow-md.p-6.mb-6 {
        padding: 1rem !important;
    }

    .bg-white.dark\\:bg-gray-800.rounded-lg.shadow-md.p-6.mb-6 .flex.justify-between {
        flex-direction: column;
        gap: 0.75rem;
    }

    .bg-white.dark\\:bg-gray-800.rounded-lg.shadow-md.p-6.mb-6 .text-right {
        text-align: left;
    }

    /* Add excerpt form mobile */
    .bg-white.dark\\:bg-gray-800.rounded-lg.shadow-md.p-6.mb-6 h2 {
        font-size: 1rem;
    }

    /* Save Changes button */
    #excerpts-form .flex.justify-end {
        flex-direction: column;
    }

    #excerpts-form .flex.justify-end button {
        width: 100%;
    }
}

/* Show table on larger screens */
@media (min-width: 768px) {
    #excerpts-form .mobile-excerpt-cards {
        display: none !important;
    }
}

/* ==========================================================================
   HOME PAGE - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Target home page via body class and content wrapper */
    .home-page .home,
    body.home-page .home {
        padding: 0 !important;
    }

    /* Force single column layout */
    .home .grid,
    .home-page .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .home .grid.lg\:grid-cols-3,
    .home .grid.lg\:grid-cols-2,
    .home .grid.grid-cols-1,
    .home-page .grid.lg\:grid-cols-3,
    .home-page .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Content cards */
    .home .content-card,
    .home-page .content-card:not(.container) {
        margin-bottom: 0;
        padding: 1rem !important;
        border-radius: 0.5rem;
    }

    .home .content-card .p-6,
    .home-page .content-card .p-6 {
        padding: 1rem !important;
    }

    /* Cards with p-6 class directly */
    .home .rounded-lg.p-6,
    .home-page .rounded-lg.p-6 {
        padding: 1rem !important;
    }

    /* Headings */
    .home h2.text-xl,
    .home-page h2.text-xl {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }

    .home h3.text-lg,
    .home-page h3.text-lg {
        font-size: 1rem !important;
    }

    /* Stats numbers */
    .home .text-4xl,
    .home-page .text-4xl {
        font-size: 2rem !important;
    }

    /* Practice chart */
    .home .h-48,
    .home-page .h-48 {
        height: 150px !important;
    }

    /* Quick actions grid - 2 columns on mobile */
    .home .grid-cols-2,
    .home-page .home .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .home .action-card,
    .home-page .action-card {
        padding: 0.875rem !important;
        min-height: 90px;
    }

    .home .action-card i,
    .home-page .action-card i {
        width: 1.5rem !important;
        height: 1.5rem !important;
        margin-bottom: 0.375rem !important;
    }

    .home .action-card span,
    .home-page .action-card span {
        font-size: 0.75rem !important;
        line-height: 1.2;
        text-align: center;
    }

    /* Resource cards */
    .home .resource-card,
    .home-page .resource-card {
        padding: 0.75rem !important;
    }

    .home .resource-card i,
    .home-page .resource-card i {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    .home .resource-card .font-medium,
    .home-page .resource-card .font-medium {
        font-size: 0.8125rem !important;
    }

    .home .resource-card .text-xs,
    .home-page .resource-card .text-xs {
        font-size: 0.6875rem !important;
    }

    /* Event cards */
    .home .event-card,
    .home-page .event-card {
        padding: 0.75rem !important;
    }

    .home .event-date,
    .home-page .event-date {
        padding: 0.375rem !important;
        min-width: 45px;
    }

    .home .event-date .text-xs,
    .home-page .event-date .text-xs {
        font-size: 0.625rem !important;
    }

    .home .event-date .text-xl,
    .home-page .event-date .text-xl {
        font-size: 1.125rem !important;
    }

    /* Notifications */
    .home .notification-card,
    .home-page .notification-card {
        padding: 0.75rem !important;
    }

    .home .notification-icon,
    .home-page .notification-icon {
        padding: 0.375rem !important;
    }

    /* Announcement cards */
    .home .announcement-card,
    .home-page .announcement-card {
        padding: 0.75rem !important;
    }

    .home .announcement-card h3,
    .home-page .announcement-card h3 {
        font-size: 0.875rem !important;
    }

    .home .announcement-card p,
    .home-page .announcement-card p {
        font-size: 0.8125rem !important;
    }

    /* Tables in home */
    .home table,
    .home-page .home table {
        font-size: 0.75rem !important;
    }

    .home table th,
    .home table td,
    .home-page .home table th,
    .home-page .home table td {
        padding: 0.5rem 0.375rem !important;
    }

    .home .overflow-x-auto,
    .home-page .overflow-x-auto {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }

    /* Second row grid */
    .home .mt-6,
    .home-page .home .mt-6 {
        margin-top: 1rem !important;
    }

    /* Links */
    .home a.text-sm,
    .home-page a.text-sm {
        font-size: 0.8125rem !important;
    }

    /* Space between sections */
    .home .space-y-4 > * + *,
    .home-page .space-y-4 > * + * {
        margin-top: 0.75rem !important;
    }

    .home .space-y-3 > * + *,
    .home-page .space-y-3 > * + * {
        margin-top: 0.5rem !important;
    }

    /* Margin adjustments */
    .home .mb-6,
    .home-page .mb-6 {
        margin-bottom: 1rem !important;
    }

    .home .mb-4,
    .home-page .mb-4 {
        margin-bottom: 0.75rem !important;
    }

    /* Flex adjustments for home page cards */
    .home .flex.justify-between,
    .home-page .home .flex.justify-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Ensure text doesn't overflow */
    .home .truncate,
    .home-page .truncate {
        max-width: 100% !important;
    }

    /* Event card layout fix */
    .home .event-card .flex,
    .home-page .event-card .flex {
        flex-wrap: nowrap;
    }

    .home .event-card p.truncate,
    .home-page .event-card p.truncate {
        max-width: calc(100vw - 140px) !important;
    }
}

/* ==========================================================================
   FORMS - MOBILE TOUCH FRIENDLY
   ========================================================================== */

@media (max-width: 767px) {
    /* Prevent iOS zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important;
        padding: 12px !important;
        border-radius: 0.5rem;
    }

    /* Form labels */
    label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
        display: block;
    }

    /* Form groups */
    .form-group,
    .space-y-4 > div {
        margin-bottom: 1rem;
    }

    /* Submit buttons full width */
    form button[type="submit"],
    form .btn-primary {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 1rem;
    }

    /* Checkbox and radio improvements */
    input[type="checkbox"],
    input[type="radio"] {
        width: 22px;
        height: 22px;
        margin-right: 0.75rem;
    }

    /* Range sliders */
    input[type="range"] {
        height: 44px;
        -webkit-appearance: none;
        appearance: none;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
        -webkit-appearance: none;
        appearance: none;
    }

    input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================================================
   BUTTONS - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .btn,
    button,
    [type="button"],
    [type="submit"] {
        padding: 12px 16px;
        font-size: 0.9375rem;
        border-radius: 0.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .btn-icon {
        flex-direction: row;
        gap: 0.5rem;
    }

    .btn-icon i {
        width: 18px;
        height: 18px;
    }

    /* Button groups stack on mobile */
    .btn-group,
    .flex.gap-2,
    .flex.gap-4,
    .flex.space-x-2,
    .flex.space-x-4 {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn,
    .flex.gap-2 .btn,
    .flex.gap-4 .btn {
        width: 100%;
    }
}

/* ==========================================================================
   MODALS - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Full screen modals on mobile */
    .modal-overlay .modal-content,
    .fixed.inset-0 > div:not(.absolute),
    [class*="relative top-20"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: 100vh;
        top: 0 !important;
    }

    /* Modal headers */
    .modal-content h3,
    .modal-content .text-lg {
        font-size: 1.125rem;
        padding: 1rem;
        border-bottom: 1px solid var(--color-border-primary);
    }

    /* Modal body */
    .modal-content form {
        padding: 1rem;
    }

    /* Modal footer buttons */
    .modal-content .flex.justify-end {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        border-top: 1px solid var(--color-border-primary);
    }

    .modal-content .flex.justify-end button {
        width: 100%;
    }
}

/* ==========================================================================
   LIST MANAGEMENT PAGE - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* List cards grid */
    .grid.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Individual list card */
    .border.rounded-lg.p-4 {
        padding: 1rem;
    }

    /* Card header */
    .border.rounded-lg .flex.justify-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Card meta grid */
    .border.rounded-lg .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    /* Stats at bottom */
    .border.rounded-lg .border-t .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================================================
   ALERTS & MESSAGES - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .alert,
    [class*="bg-green-50"],
    [class*="bg-red-50"],
    [class*="bg-blue-50"],
    [class*="bg-yellow-50"] {
        padding: 0.875rem !important;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }

    .alert .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .alert i,
    .alert svg {
        flex-shrink: 0;
    }

    .alert p {
        flex: 1;
        min-width: 0;
    }
}

/* ==========================================================================
   EMPTY STATES - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .empty-state {
        padding: 2rem 1rem !important;
        text-align: center;
    }

    .empty-state .empty-icon {
        margin-bottom: 1rem;
    }

    .empty-state .empty-icon i {
        width: 48px !important;
        height: 48px !important;
    }

    .empty-state h3 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .empty-state p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .empty-state .btn {
        width: 100%;
    }
}

/* ==========================================================================
   PRACTICE TIMER - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Timer display */
    .timer-display,
    #timer-display {
        font-size: 4rem !important;
        letter-spacing: -2px;
    }

    /* Timer controls */
    .timer-controls,
    .control-buttons {
        gap: 0.75rem !important;
    }

    .timer-controls button,
    .control-button {
        width: 56px !important;
        height: 56px !important;
    }

    /* Session info */
    .session-info {
        padding: 1rem !important;
    }

    /* Interval settings */
    .interval-settings .grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   INTERVAL PRACTICE - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .interval-practice-container {
        padding: 1rem;
    }

    /* Settings form */
    .interval-settings {
        padding: 1rem !important;
    }

    .interval-settings .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    /* Action buttons */
    .interval-actions {
        flex-direction: column !important;
        padding: 1rem !important;
    }

    .interval-actions .btn {
        width: 100% !important;
        min-width: unset !important;
    }
}

/* ==========================================================================
   LIBRARY PAGES - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    /* Excerpt library grid */
    .excerpt-library .grid {
        grid-template-columns: 1fr !important;
    }

    /* Excerpt cards */
    .excerpt-card {
        padding: 1rem;
    }

    /* Filter section */
    .library-filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    .library-filters select,
    .library-filters input {
        width: 100%;
    }

    /* Search bar */
    .search-bar {
        width: 100%;
    }

    .search-bar input {
        width: 100%;
    }
}

/* ==========================================================================
   SCROLLING IMPROVEMENTS
   ========================================================================== */

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

/* Momentum scrolling for iOS */
.overflow-auto,
.overflow-y-auto,
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars on mobile but keep functionality */
@media (max-width: 767px) {
    .hide-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }
}

/* ==========================================================================
   SAFE AREA INSETS (NOTCH SUPPORT)
   ========================================================================== */

@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .corner-hamburger {
        top: calc(env(safe-area-inset-top) + 0.5rem);
        left: calc(env(safe-area-inset-left) + 0.5rem);
    }

    .mobile-sidebar .absolute {
        padding-top: env(safe-area-inset-top);
    }
}

/* ==========================================================================
   PRINT STYLES (HIDE ON PRINT)
   ========================================================================== */

@media print {
    .corner-hamburger,
    .mobile-sidebar,
    .desktop-sidebar,
    .btn,
    button {
        display: none !important;
    }
}

/* ==========================================================================
   LANDSCAPE ORIENTATION FIXES
   ========================================================================== */

@media (max-width: 767px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    .py-6 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* Smaller timer in landscape */
    .timer-display,
    #timer-display {
        font-size: 3rem !important;
    }

    /* Two columns in landscape for some grids */
    .home .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================================================
   TOUCH FEEDBACK
   ========================================================================== */

/* Add visual feedback for touch */
.btn:active,
button:active,
a:active,
.practice-list-card:active,
.action-card:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Disable text selection on interactive elements */
.btn,
button,
.practice-list-card,
.action-card,
nav a {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ==========================================================================
   DARK MODE MOBILE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 767px) {
    .dark .content-card,
    .dark-mode .content-card {
        background-color: var(--color-bg-secondary);
    }

    .dark .mobile-sidebar .absolute,
    .dark-mode .mobile-sidebar .absolute {
        background-color: var(--color-bg-secondary);
    }
}
