/* ====================================
   RESPONSIVE CSS - Python Learning Platform
   ==================================== */

/* Tablet - Medium screens */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-md);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile - Small screens */
@media (max-width: 768px) {

    /* Typography adjustments */
    h1 {
        font-size: var(--text-2xl);
    }

    h2 {
        font-size: var(--text-xl);
    }

    h3 {
        font-size: var(--text-lg);
    }

    /* Layout */
    .container {
        padding: 0 var(--space-sm);
    }

    /* Cards */
    .question-container {
        padding: var(--space-md);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Buttons */
    .action-buttons {
        flex-direction: column;
    }

    /* Test header */
    .test-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .test-info {
        width: 100%;
        justify-content: center;
    }

    /* Profile */
    .profile-info {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {

    /* Login */
    .login-card {
        padding: var(--space-lg);
    }

    .login-form .form-input {
        font-size: var(--text-lg);
        padding: var(--space-sm) var(--space-md);
    }

    /* Generated ID */
    .generated-id .id-value {
        font-size: var(--text-2xl);
    }

    /* Questions */
    .answer-option {
        padding: var(--space-sm) var(--space-md);
    }

    /* Test navigation */
    .test-navigation {
        flex-direction: column;
    }

    .test-navigation .btn {
        width: 100%;
    }

    /* Modal */
    .modal {
        margin: var(--space-sm);
        max-width: calc(100vw - var(--space-lg));
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }

    .answer-option {
        min-height: 48px;
    }

    .nav-item {
        min-height: 44px;
    }

    /* Remove hover effects that don't work on touch */
    .card-hover:hover {
        transform: none;
    }

    .btn-primary:hover:not(:disabled) {
        transform: none;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .sidebar-toggle,
    .test-header,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .question-container {
        box-shadow: none;
        border: 1px solid var(--gray-200);
        break-inside: avoid;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode (if ever needed) */
@media (prefers-color-scheme: dark) {
    /* Currently keeping light theme only */
    /* Dark mode variables would go here */
}