/* Responsive Design for Little Potato Robotics Website */

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }
    
    .nav-list {
        gap: 1.5rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .robot-grid,
    .programs-grid,
    .resources-grid,
    .team-members {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    /* Header - Remove logo, keep only navigation */
    .header {
        padding: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .header-content {
        padding: 0;
        justify-content: center;
        flex-wrap: nowrap;
    }
    
    /* Hide logo on mobile */
    .logo {
        display: none;
    }
    
    /* Navigation - Full width, horizontal scroll */
    .nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #fff;
        border-bottom: 1px solid #e9ecef;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        height: 60px;
        overflow: hidden;
    }
    
    /* Add padding to body to account for fixed navigation */
    body {
        padding-top: 60px;
    }
    
    .nav-list {
        display: flex;
        flex-direction: row;
        gap: 0;
        padding: 0;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        height: 60px;
        align-items: center;
    }
    
    .nav-list::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        flex-shrink: 0;
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: 0.8rem 1rem;
        color: #333 !important;
        font-weight: 500;
        font-size: 0.85rem;
        text-decoration: none;
        transition: all 0.3s ease;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-user-select: none;
        user-select: none;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background-color: #f8f9fa;
        color: var(--primary-color) !important;
        border-bottom-color: var(--primary-color);
    }
    
    /* Remove dropdown icons */
    .nav-link i {
        display: none;
    }
    
    /* Remove dropdown functionality */
    .dropdown-menu {
        display: none !important;
    }
    
    /* Remove mobile menu toggle */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* Improve touch targets for mobile */
    .btn {
        min-height: 44px;
        padding: 12px 24px;
    }
    
    /* Ensure proper spacing for mobile sections */
    .section {
        padding: 60px 0;
    }
    
    /* iPhone Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
        .nav {
            -webkit-overflow-scrolling: touch;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background-color: #fff;
            z-index: 999;
        }
        
        .nav-link {
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            -webkit-user-select: none;
            user-select: none;
        }
    }
    
    /* Android Chrome specific fixes */
    @supports not (-webkit-touch-callout: none) {
        .nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background-color: #fff;
            z-index: 999;
        }
        
        .nav-link {
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            -webkit-user-select: none;
            user-select: none;
        }
    }
    
    
    /* Hero Section */
    .hero {
        padding: 100px 0 60px;
        min-height: calc(100vh - 60px);
    }
    
    .hero-logo-img {
        width: 160px;
        height: 160px;
        border-radius: 12px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Robot Showcase */
    .robot-showcase {
        padding: 80px 0;
        min-height: auto;
    }
    
    .robot-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .robot-card {
        padding: 0 !important;
        margin-bottom: 2rem !important;
        border-radius: 15px !important;
        overflow: hidden !important;
    }
    
    /* About Section */
    .about {
        padding: 60px 0;
    }
    
    /* Programs Section */
    .programs {
        padding: 60px 0;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .program-card {
        padding: 1.5rem;
    }
    
    /* FTC Section */
    .ftc-section {
        padding: 60px 0;
    }
    
    .ftc-logo-img {
        max-width: 38px;
    }
    
    .ftc-intro {
        margin-bottom: 3rem;
    }
    
    .ftc-intro p {
        font-size: 1rem;
    }
    
    .ftc-tagline {
        font-size: 1.25rem;
    }
    
    .impact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .impact-item {
        padding: 1.5rem;
    }
    
    .ftc-team-info {
        padding: 2rem;
    }
    
    /* Media Section */
    .media {
        padding: 60px 0;
    }
    
    .tab-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Resources Section */
    .resources {
        padding: 60px 0;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .team-members {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .team-member {
        padding: 1rem;
    }
    
    .member-photo {
        width: 100px;
        height: 100px;
    }
    
    
    .resource-card {
        padding: 1.5rem;
    }
    
    /* Sponsors Section */
    .sponsors {
        padding: 60px 0;
    }
    
    .sponsor-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sponsor-cta {
        padding: 2rem;
    }
    
    /* NPO Section */
    .npo {
        padding: 60px 0;
    }
    
    .npo-details {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .npo-intro {
        margin-bottom: 3rem;
    }
    
    .npo-intro p {
        font-size: 1rem;
    }
    
    /* Contact Section */
    .contact {
        padding: 60px 0;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header */
    .header-content {
        padding: 0.5rem 0;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo-img {
        width: 60px;
        height: 60px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    /* Remove mobile menu toggle */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* Navigation positioning handled in main mobile breakpoint */
    
    /* Adjust body padding for small screens */
    body {
        padding-top: 60px;
    }
    
    /* Ensure navigation stays fixed on small screens */
    .nav {
        height: 60px;
    }
    
    .nav-list {
        height: 60px;
    }
    
    /* Safari-specific navigation positioning handled in main mobile breakpoint */
    
    
    /* About Section Mobile */
    .about-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .hero-logo-img {
        width: 100px;
        height: 70px;
    }
    
    .hero-content h3 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .about-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .card-icon {
        font-size: 2rem;
        margin-top: 0;
    }
    
    .card-content h3 {
        font-size: 1.2rem;
    }
    
    /* Team Section Mobile */
    .team-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .team-hero-icon {
        font-size: 3rem;
    }
    
    .team-hero-content h3 {
        font-size: 1.5rem;
    }
    
    .team-hero-content p {
        font-size: 1rem;
    }
    
    .member-photo {
        width: 120px;
        height: 120px;
    }
    
    .member-role-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .member-info h4 {
        font-size: 1.2rem;
    }
    
    .member-role {
        font-size: 0.85rem;
    }
    
    .member-bio {
        font-size: 0.9rem;
    }
    
    /* Robot Section Mobile */
    .robot-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .robot-hero-icon {
        font-size: 3rem;
    }
    
    .robot-hero-content h3 {
        font-size: 1.5rem;
    }
    
    .robot-hero-content p {
        font-size: 1rem;
    }
    
    .robot-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .robot-image-placeholder {
        height: 400px !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 15px 15px 0 0 !important;
    }
    
    .robot-spec-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
        opacity: 0.8;
    }
    
    .robot-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .robot-info {
        padding: 1.5rem !important;
        width: 100% !important;
    }
    
    .robot-info h3 {
        font-size: 1.5rem;
    }
    
    .robot-year {
        font-size: 1rem;
    }
    
    .robot-description {
        font-size: 1.05rem;
        line-height: 1.6;
    }
    
    .feature-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-logo-img {
        width: 140px;
        height: 140px;
        border-radius: 12px;
        padding: 6px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    /* Cards */
    .robot-card,
    .program-card,
    .resource-card {
        padding: 1rem;
    }
    
    /* FTC Section Mobile */
    .ftc-section {
        padding: 40px 0;
    }
    
    .ftc-logo-img {
        max-width: 30px;
    }
    
    .ftc-intro {
        margin-bottom: 2rem;
    }
    
    .ftc-tagline {
        font-size: 1.1rem;
    }
    
    .ftc-intro p {
        font-size: 0.9rem;
    }
    
    .impact-item {
        padding: 1rem;
    }
    
    .ftc-team-info {
        padding: 1.5rem;
    }
    
    .ftc-competition {
        padding: 1.5rem;
    }
    
    .ftc-cta {
        padding: 2rem;
    }
    
    .ftc-cta .btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .robot-image-placeholder {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .program-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .resource-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Media */
    .media-placeholder {
        width: 325px;
        height: 244px;
        font-size: 1.5rem;
    }
    
    .media-overlay {
        font-size: 1.25rem;
    }
    
    .media-source {
        font-size: 0.75rem;
    }
    
    .media-link:hover {
        transform: translateY(-3px);
    }
    
    .sponsor-placeholder {
        width: 120px;
        height: 80px;
        font-size: 1.5rem;
    }
    
    /* NPO Section Mobile */
    .npo {
        padding: 40px 0;
    }
    
    .npo-intro {
        margin-bottom: 2rem;
    }
    
    .npo-intro p {
        font-size: 0.9rem;
    }
    
    .npo-details {
        gap: 1.5rem;
    }
    
    .npo-info h4,
    .npo-cta h4 {
        font-size: 1.25rem;
    }
    
    .npo-item span {
        font-size: 1rem;
    }
    
    .npo-cta .btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    /* Contact */
    .contact-content {
        gap: 1.5rem;
    }
    
    .contact-form {
        order: -1;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    
    p {
        font-size: 0.9rem;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .container {
        padding: 0 5px;
    }
    
    /* Header adjustments for very small screens */
    .header-content {
        padding: 0.2rem 0;
    }
    
    .logo-img {
        width: 50px;
        height: 50px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    /* Remove mobile menu toggle */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* More compact navigation for very small screens */
    .nav-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    /* Ensure navigation stays fixed on very small screens */
    .nav {
        height: 60px;
    }
    
    .nav-list {
        height: 60px;
    }
    
    body {
        padding-top: 60px;
    }
    
    /* About Section Very Small Screens */
    .about-hero-card {
        padding: 1.5rem;
    }
    
    .hero-logo-img {
        width: 80px;
        height: 60px;
    }
    
    .hero-content h3 {
        font-size: 1.3rem;
    }
    
    .about-card {
        padding: 1.2rem;
    }
    
    .card-icon {
        font-size: 1.8rem;
    }
    
    /* Team Section Very Small Screens */
    .team-hero-card {
        padding: 1.5rem;
    }
    
    .team-hero-icon {
        font-size: 2.5rem;
    }
    
    .team-hero-content h3 {
        font-size: 1.3rem;
    }
    
    .member-photo {
        width: 100px;
        height: 100px;
    }
    
    .member-role-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .member-info h4 {
        font-size: 1.1rem;
    }
    
    .member-role {
        font-size: 0.8rem;
    }
    
    .member-bio {
        font-size: 0.85rem;
    }
    
    /* Robot Section Very Small Screens */
    .robot-hero-card {
        padding: 1.5rem;
    }
    
    .robot-hero-icon {
        font-size: 2.5rem;
    }
    
    .robot-hero-content h3 {
        font-size: 1.3rem;
    }
    
    .robot-image-placeholder {
        height: 360px !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 15px 15px 0 0 !important;
    }
    
    .robot-spec-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        top: 8px;
        right: 8px;
        opacity: 0.8;
    }
    
    .robot-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .robot-info {
        padding: 1.3rem !important;
        width: 100% !important;
    }
    
    .robot-info h3 {
        font-size: 1.4rem;
    }
    
    .robot-year {
        font-size: 0.95rem;
    }
    
    .robot-description {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .feature-tag {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    
    /* NPO Section Mobile */
    .npo-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .npo-hero-icon {
        font-size: 3rem;
    }
    
    .npo-hero-content h3 {
        font-size: 1.5rem;
    }
    
    .npo-hero-content p {
        font-size: 1rem;
    }
    
    .npo-details {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .npo-info-card,
    .npo-cta-card {
        padding: 1.5rem;
    }
    
    .npo-card-icon {
        font-size: 2rem;
    }
    
    .npo-card-content h4 {
        font-size: 1.3rem;
    }
    
    /* FTC Section Mobile */
    .ftc-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .ftc-hero-logo {
        order: -1;
    }
    
    .ftc-logo-img {
        max-width: 60px;
    }
    
    .ftc-hero-content h3 {
        font-size: 1.5rem;
    }
    
    .ftc-tagline {
        font-size: 1.1rem;
    }
    
    .ftc-hero-content p {
        font-size: 1rem;
    }
    
    .impact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .impact-card {
        padding: 1.5rem;
    }
    
    .impact-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .impact-content h4 {
        font-size: 1.2rem;
    }
    
    /* Contact Section Mobile */
    .contact-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .contact-hero-icon {
        font-size: 3rem;
    }
    
    .contact-hero-content h3 {
        font-size: 1.5rem;
    }
    
    .contact-hero-content p {
        font-size: 1rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Photos Section Mobile */
    .photos-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .photos-hero-icon {
        font-size: 3rem;
    }
    
    .photos-hero-content h3 {
        font-size: 1.5rem;
    }
    
    .photos-hero-content p {
        font-size: 1rem;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .media-item {
        padding: 0 !important;
        border-radius: 15px !important;
        overflow: hidden !important;
    }
    
    .media-placeholder {
        height: 250px !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 15px 15px 0 0 !important;
    }
    
    .media-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .media-badge {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .media-info {
        padding: 1.5rem;
    }
    
    .media-info h4 {
        font-size: 1.2rem;
    }
    
    .media-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .media-source {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    /* Photos Section Very Small Screens */
    .media-placeholder {
        height: 220px !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 15px 15px 0 0 !important;
    }
    
    .media-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .media-item {
        padding: 0 !important;
        border-radius: 15px !important;
        overflow: hidden !important;
    }
    
    .media-badge {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .media-info {
        padding: 1.2rem !important;
        width: 100% !important;
    }
    
    .media-info h4 {
        font-size: 1.1rem;
    }
    
    .media-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .media-source {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Navigation positioning handled in main mobile breakpoint */
    
    /* Adjust body padding for very small screens */
    body {
        padding-top: 50px;
    }
    
    .hero-logo-img {
        width: 120px;
        height: 120px;
        border-radius: 10px;
        padding: 5px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .robot-card,
    .program-card,
    .resource-card {
        padding: 0.75rem;
    }
    
    /* FTC Section Small Mobile */
    .ftc-section {
        padding: 30px 0;
    }
    
    .ftc-logo-img {
        max-width: 25px;
    }
    
    .ftc-intro p {
        font-size: 0.85rem;
    }
    
    .ftc-tagline {
        font-size: 1rem;
    }
    
    .impact-item {
        padding: 0.75rem;
    }
    
    .ftc-team-info {
        padding: 1rem;
    }
    
    .ftc-competition {
        padding: 1rem;
    }
    
    .ftc-cta {
        padding: 1.5rem;
    }
    
    .ftc-cta .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        margin-top: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .hero {
        background: none !important;
        color: #000 !important;
        padding: 20px 0 !important;
    }
    
    .hero-title,
    .hero-subtitle,
    .hero-description {
        color: #000 !important;
    }
    
    .robot-showcase,
    .programs,
    .resources {
        background: none !important;
    }
    
    .robot-card,
    .program-card,
    .resource-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .section-title::after {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .robot-card,
    .program-card,
    .resource-card {
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--dark-bg-primary);
        color: var(--dark-text-primary);
    }
    
    .header {
        background-color: var(--dark-bg-primary);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        border-bottom: 1px solid #30363d;
    }
    
    .header .nav-link {
        color: var(--dark-text-primary);
        font-weight: 600;
    }
    
    .header .nav-link:hover {
        color: var(--primary-color);
    }
    
    .header .logo-text {
        color: var(--primary-color);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    /* Dark mode mobile navigation */
    .nav {
        background-color: var(--dark-bg-primary);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        border-bottom: 1px solid var(--dark-bg-tertiary);
    }
    
    .nav-item {
        border-bottom: none;
    }
    
    .nav-link {
        color: var(--dark-text-primary) !important;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background-color: var(--dark-bg-secondary);
        color: var(--primary-color) !important;
        border-bottom-color: var(--primary-color);
    }
    
    .dropdown-menu {
        background-color: var(--dark-bg-secondary);
    }
    
    .dropdown-menu a {
        color: var(--dark-text-secondary) !important;
        border-bottom: 1px solid #30363d;
    }
    
    .dropdown-menu a:hover {
        background-color: var(--dark-bg-tertiary);
        color: var(--primary-color) !important;
    }
    
    .mobile-menu-toggle span {
        background-color: var(--dark-text-primary);
    }
    
    /* Dark mode iPhone Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
        .nav {
            background-color: var(--dark-bg-primary);
        }
    }
    
    .robot-card,
    .program-card,
    .resource-card {
        background-color: var(--dark-bg-secondary);
        color: var(--dark-text-primary);
        border: 1px solid #30363d;
    }
    
    .robot-image-placeholder,
    .media-placeholder,
    .sponsor-placeholder {
        background-color: var(--dark-bg-tertiary);
        color: var(--dark-text-muted);
        border: 1px solid #30363d;
    }
    
    .form input,
    .form textarea {
        background-color: var(--dark-bg-secondary);
        color: var(--dark-text-primary);
        border-color: #30363d;
        -webkit-text-fill-color: var(--dark-text-primary);
    }
    
    .form input::placeholder,
    .form textarea::placeholder {
        color: var(--dark-text-muted);
        -webkit-text-fill-color: var(--dark-text-muted);
    }
    
    .tab-btn {
        background-color: var(--dark-bg-tertiary);
        color: var(--dark-text-primary);
        border: 1px solid #30363d;
    }
    
    .tab-btn.active,
    .tab-btn:hover {
        background-color: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    /* Additional dark mode improvements */
    .section-title {
        color: var(--dark-text-primary);
    }
    
    .section-title::after {
        background-color: var(--primary-color);
    }
    
    .btn-outline {
        border-color: var(--dark-text-muted);
        color: var(--dark-text-primary);
    }
    
    .btn-outline:hover {
        background-color: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    /* Chrome-specific dark mode fixes */
    @supports (-webkit-appearance: none) and (not (-ms-ime-align: auto)) {
        .header .nav-link {
            -webkit-text-fill-color: var(--dark-text-primary) !important;
        }
        
        .form input,
        .form textarea {
            -webkit-text-fill-color: var(--dark-text-primary) !important;
        }
        
        .form input::placeholder,
        .form textarea::placeholder {
            -webkit-text-fill-color: var(--dark-text-muted) !important;
        }
        
        h1, h2, h3, h4, h5, h6 {
            -webkit-text-fill-color: var(--dark-text-primary) !important;
        }
        
        p {
            -webkit-text-fill-color: var(--dark-text-secondary) !important;
        }
    }
}
