/* ==========================================================================
   Responsive Styles - Mobile First Approach
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mobile (below 640px)
   -------------------------------------------------------------------------- */

@media (max-width: 639px) {
    .app {
        padding: var(--space-2);
    }

    .app-container {
        gap: var(--space-2);
    }

    /* Header - more compact */
    .header-top {
        padding: var(--space-3);
    }

    .header-title h1 {
        font-size: var(--font-size-lg);
    }

    .header-logo {
        width: 24px;
        height: 24px;
    }

    .theme-toggle-btn {
        width: 40px;
        height: 40px;
    }

    .theme-toggle-btn svg {
        width: 20px;
        height: 20px;
    }

    .header-body {
        padding: var(--space-3);
    }

    /* Search - larger touch targets */
    .search-form {
        flex-direction: column;
        gap: var(--space-2);
    }

    .group-inputs,
    .teacher-inputs {
        flex-direction: column;
        gap: var(--space-2);
    }

    .input,
    .select {
        height: 50px;
        font-size: var(--font-size-base);
    }

    .btn-search {
        width: 100%;
        min-width: auto;
        height: 50px;
        font-size: var(--font-size-base);
    }

    /* Radio tabs - larger */
    .radio-tab-label {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-base);
    }

    /* Selection Panel */
    .selection-panel {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .selection-name {
        font-size: var(--font-size-base);
    }

    .selection-actions {
        justify-content: flex-end;
    }

    /* Week Navigation - compact */
    .week-nav {
        gap: var(--space-2);
        padding: 0 var(--space-2);
    }

    .week-display {
        order: -1;
        width: 100%;
        min-width: auto;
        font-size: var(--font-size-base);
        margin-bottom: var(--space-1);
    }

    .week-nav-btn {
        width: 44px;
        height: 44px;
    }

    .week-nav-btn svg {
        width: 20px;
        height: 20px;
    }

    .btn-today {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-base);
    }

    /* Day Card - compact */
    .day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: var(--space-3);
    }

    .day-title {
        font-size: var(--font-size-base);
    }

    .day-date {
        font-size: var(--font-size-sm);
    }

    .day-body {
        padding: var(--space-3);
    }

    /* Lesson - larger text */
    .lesson {
        grid-template-columns: 1fr;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .lesson-time {
        flex-direction: row;
        justify-content: flex-start;
        gap: var(--space-2);
        padding-bottom: var(--space-2);
        border-bottom: 1px solid var(--color-border);
    }

    .lesson-time-start {
        font-size: var(--font-size-lg);
        font-weight: var(--font-weight-bold);
    }

    .lesson-time-end {
        margin-top: 0;
        font-size: var(--font-size-base);
    }

    .lesson-time-end::before {
        content: '—';
        margin-right: var(--space-1);
    }

    .lesson-name {
        font-size: var(--font-size-base);
    }

    .lesson-details {
        font-size: var(--font-size-base);
    }

    .lesson-info-btn {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }

    /* Floating Elements */
    .float-buttons {
        bottom: var(--space-3);
        right: var(--space-3);
    }

    .float-btn {
        width: 44px;
        height: 44px;
    }

    .float-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Header actions */
    .header-actions {
        gap: var(--space-1);
    }

    .boosty-btn {
        width: 40px;
        height: 40px;
    }

    .boosty-btn svg {
        width: 20px;
        height: 20px;
    }

    .install-prompt {
        bottom: var(--space-3);
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .install-prompt-text {
        font-size: var(--font-size-base);
    }

    /* Bookmarks - compact */
    .bookmarks {
        padding: var(--space-2);
        min-height: 40px;
    }

    .bookmarks-empty {
        font-size: var(--font-size-sm);
    }

    .bookmarks-empty svg {
        display: none;
    }

    .bookmark-item {
        font-size: var(--font-size-sm);
        padding: var(--space-2) var(--space-3);
    }

    /* Modal */
    .modal {
        margin: var(--space-2);
        max-height: calc(100vh - var(--space-4));
    }

    .modal-header {
        padding: var(--space-4);
    }

    .modal-title {
        font-size: var(--font-size-base);
    }

    .modal-body {
        padding: var(--space-4);
        font-size: var(--font-size-base);
    }

    /* Search results - larger */
    .search-results-list {
        max-height: 250px;
    }

    .search-result-item {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-base);
    }
}

/* --------------------------------------------------------------------------
   Tablet (640px to 1023px)
   -------------------------------------------------------------------------- */

@media (min-width: 640px) and (max-width: 1023px) {
    .app {
        padding: var(--space-4);
    }

    .header-top {
        padding: var(--space-4) var(--space-5);
    }

    .header-body {
        padding: var(--space-4) var(--space-5);
    }

    .header-title h1 {
        font-size: var(--font-size-xl);
    }

    .day-header {
        padding: var(--space-4);
    }

    .day-body {
        padding: var(--space-4);
    }

    .lesson {
        grid-template-columns: 90px 1fr;
    }

    .lesson-time-start {
        font-size: var(--font-size-lg);
    }
}

/* --------------------------------------------------------------------------
   Desktop (1024px and up)
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
    .app {
        padding: var(--space-6);
    }

    .header-top {
        padding: var(--space-5) var(--space-6);
    }

    .header-body {
        padding: var(--space-5) var(--space-6);
    }

    .header-title h1 {
        font-size: var(--font-size-2xl);
    }

    .day-header {
        padding: var(--space-4) var(--space-5);
    }

    .day-body {
        padding: var(--space-4) var(--space-5);
    }

    .lesson {
        grid-template-columns: 100px 1fr;
    }

    .lesson-time-start {
        font-size: var(--font-size-xl);
    }
}

/* --------------------------------------------------------------------------
   Large Desktop (1200px and up)
   -------------------------------------------------------------------------- */

@media (min-width: 1200px) {
    .app {
        padding: var(--space-8);
    }

    .schedule {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .day-card:nth-child(7) {
        grid-column: 1 / -1;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    .app {
        padding: 0;
    }

    .bookmarks,
    .float-buttons,
    .install-prompt,
    .theme-toggle-btn,
    .selection-actions,
    .week-nav,
    .footer {
        display: none !important;
    }

    .header {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .day-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .lesson {
        border-left-width: 2px;
    }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
