/* Academic Mobile-First Responsive CSS - NO ANIMATIONS */

/* Remove ALL animations, transitions, transforms globally */
* {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    transform: none !important;
    scroll-behavior: auto !important;
}

/* Base mobile-first approach */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    width: 100%;
    overflow-x: hidden;
}

/* Mobile: 320px - 767px */
@media screen and (max-width: 767px) {
    body {
        font-size: 14px;
        line-height: 1.6;
        padding: 10px;
        max-width: 100%;
    }

    h1 {
        font-size: 20px !important;
        margin: 15px 0 !important;
    }

    h2 {
        font-size: 18px !important;
        margin: 12px 0 !important;
    }

    h3 {
        font-size: 16px !important;
        margin: 10px 0 !important;
    }

    /* Navigation mobile menu */
    .academic-nav {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
    }

    .academic-nav .container {
        flex-direction: column;
        padding: 10px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 10px;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .nav-links a {
        display: block;
        padding: 10px;
        text-align: center;
    }

    /* Tables responsive scroll */
    table {
        font-size: 12px !important;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    table th, table td {
        padding: 5px !important;
        min-width: 100px;
    }

    /* Stats grid mobile */
    .stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        padding: 15px 0 !important;
    }

    .stat .value {
        font-size: 18px !important;
    }

    .stat .label {
        font-size: 10px !important;
    }

    /* Features/specs mobile */
    .features, .spec-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Code blocks mobile */
    pre {
        font-size: 12px !important;
        padding: 10px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Abstract mobile */
    .abstract {
        margin: 15px 0 !important;
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* Remove unnecessary padding/margins */
    .container {
        padding: 0 10px !important;
    }

    .section {
        margin: 20px 0 !important;
    }

    /* Buttons mobile */
    .btn-primary {
        width: 100%;
        padding: 12px !important;
        font-size: 14px !important;
        touch-action: manipulation;
    }

    /* Timeline mobile */
    .timeline {
        grid-template-columns: 1fr !important;
    }

    /* Footer mobile */
    footer {
        font-size: 12px !important;
        padding: 20px 10px !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }

    /* Mathematical blocks mobile */
    .theorem, .lemma, .definition, .proof, .equation {
        margin: 10px 0 !important;
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* Hide print-only content */
    @page {
        display: none;
    }
}

/* Tablet: 768px - 1024px */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    body {
        font-size: 15px;
        line-height: 1.7;
        padding: 20px;
        max-width: 100%;
    }

    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    h3 {
        font-size: 17px !important;
    }

    /* Navigation tablet */
    .academic-nav .container {
        padding: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Tables tablet */
    table {
        font-size: 13px !important;
    }

    table th, table td {
        padding: 8px !important;
    }

    /* Stats grid tablet */
    .stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    /* Features tablet */
    .features, .spec-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    /* Code blocks tablet */
    pre {
        font-size: 13px !important;
        padding: 12px !important;
    }

    /* Timeline tablet */
    .timeline {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Footer tablet */
    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Large tablets and small laptops: 1025px - 1366px */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
    body {
        max-width: 90%;
        margin: 0 auto;
    }

    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    a, button, .btn-primary {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Increase spacing between clickable elements */
    .nav-links a {
        padding: 12px 16px;
    }

    /* Disable hover effects on touch devices */
    a:hover, button:hover {
        opacity: 1 !important;
        background-color: inherit !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: black;
    }

    a {
        color: #0000EE;
        text-decoration: underline;
    }

    table, th, td {
        border: 2px solid black !important;
    }
}

/* Reduced motion support (already no animations) */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles for mobile printing */
@media print {
    body {
        font-size: 10pt !important;
        line-height: 1.3 !important;
    }

    .academic-nav,
    .nav-links,
    .btn-primary,
    footer {
        display: none !important;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    table, figure {
        page-break-inside: avoid;
    }
}

/* Orientation changes */
@media screen and (orientation: landscape) and (max-width: 767px) {
    .stats {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100%;
    }

    input, textarea, select {
        font-size: 16px; /* Prevents zoom on focus */
    }
}

/* Scrollbar styling for better mobile experience */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #888;
}

/* Ensure readable font sizes */
p, li, td {
    font-size: max(14px, 1em);
}

/* Prevent horizontal scroll */
.container, .section, .content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive embeds */
iframe, embed, object, video {
    max-width: 100%;
}

/* Make sure all clickable elements are easily tappable */
a, button, input, textarea, select {
    touch-action: manipulation;
}

/* Ensure form elements are mobile-friendly */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
}

/* Loading states without animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error states */
.error {
    color: #d00;
    border-color: #d00 !important;
}

/* Success states */
.success {
    color: #0a0;
    border-color: #0a0 !important;
}

/* Ensure no gradients */
* {
    background-image: none !important;
}

/* Simple backgrounds only */
.hero, .header, .nav {
    background-color: #fff !important;
}

/* Utility classes for mobile */
@media screen and (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

@media screen and (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }

    .show-desktop {
        display: block !important;
    }
}