/* Responsive Styles for Microsoft 365 Copilot Training */

/* Desktops (>= 1024px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    .lesson-content {
        max-width: 800px;
    }
}

/* Tablets (>= 768px and < 1024px) */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --sidebar-width: 240px;
        --header-height: 100px;
    }

    .header-content h1 {
        font-size: 1.25rem;
    }

    .lesson-content {
        padding: var(--space-lg);
        max-width: 100%;
    }

    .lesson-article h1 {
        font-size: 1.875rem;
    }

    .lesson-article h2 {
        font-size: 1.5rem;
    }
}

/* Mobile devices (< 768px) */
@media (max-width: 767px) {
    :root {
        --header-height: 140px;
        --space-xl: 24px;
        --space-lg: 16px;
    }

    .header-content {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .header-content h1 {
        font-size: 1.125rem;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        width: 80%;
        max-width: 300px;
        height: calc(100vh - var(--header-height));
        z-index: 60;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        position: fixed;
        bottom: var(--space-lg);
        right: var(--space-lg);
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background-color: var(--accent-primary);
        color: white;
        border: none;
        font-size: 1.5rem;
        box-shadow: var(--shadow-lg);
        z-index: 70;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .sidebar-toggle:hover {
        background-color: var(--accent-hover);
    }

    .sidebar-overlay {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 55;
        display: none;
    }

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

    .lesson-content {
        padding: var(--space-md);
        width: 100%;
    }

    .breadcrumbs {
        font-size: 0.75rem;
        overflow-x: auto;
        white-space: nowrap;
    }

    .lesson-article h1 {
        font-size: 1.5rem;
    }

    .lesson-article h2 {
        font-size: 1.25rem;
    }

    .lesson-article h3 {
        font-size: 1.125rem;
    }

    .lesson-actions {
        flex-direction: column;
    }

    .lesson-actions button {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-md);
    }

    .course-overview {
        padding: var(--space-lg);
    }

    .search-panel {
        padding: var(--space-md);
    }
}

/* Very small mobile devices (< 480px) */
@media (max-width: 479px) {
    :root {
        font-size: 14px;
    }

    .header-actions button {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
    }

    .btn-icon {
        padding: var(--space-xs);
    }

    .lesson-article h1 {
        font-size: 1.375rem;
    }

    .lesson-article h2 {
        font-size: 1.125rem;
    }
}

/* Landscape mobile */
@media (max-width: 767px) and (orientation: landscape) {
    :root {
        --header-height: 100px;
    }

    .sidebar {
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
    }

    .sidebar-overlay {
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
    }
}

/* Print styles */
@media print {
    .app-header,
    .sidebar,
    .lesson-actions,
    .breadcrumbs,
    .modal,
    .sidebar-toggle,
    .sidebar-overlay {
        display: none !important;
    }

    .lesson-content {
        max-width: 100%;
        padding: 0;
    }

    .lesson-article {
        color: #000;
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.875rem;
    }
}
