/* Enhanced Mobile UI for Bird Watching Pages */

/* Mobile-First Design Enhancements */
@media (max-width: 768px) {
    /* Smooth scrolling for mobile */
    html {
        scroll-behavior: smooth;
        -webkit-text-size-adjust: 100%;
    }
    
    body {
        font-size: 16px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Enhanced Navigation for Mobile */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        max-width: 100%;
    }
    
    .nav-logo h2 a {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 700;
        text-decoration: none;
    }
    
    /* Mobile Menu Animation */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        display: flex;
        flex-direction: column;
        padding: 30px 0;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        margin: 0;
        padding: 0 20px;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 20px;
        margin: 5px 0;
        border-radius: 12px;
        background: rgba(116, 185, 255, 0.05);
        border: 1px solid rgba(116, 185, 255, 0.1);
        transition: all 0.3s ease;
        font-weight: 500;
        color: #2d3748;
        text-decoration: none;
    }
    
    .nav-menu a:hover,
    .nav-menu a:active {
        background: rgba(116, 185, 255, 0.15);
        border-color: rgba(116, 185, 255, 0.3);
        transform: translateX(5px);
    }
    
    /* Language Switcher Enhancement */
    .language-switcher {
        margin-top: 20px;
        padding: 0 20px;
    }
    
    .lang-btn {
        width: 100%;
        padding: 12px 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 25px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .lang-btn:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
    }
    
    /* Hamburger Menu Animation */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 30px;
        height: 30px;
        cursor: pointer;
        padding: 5px;
        z-index: 1001;
    }
    
    .nav-toggle span {
        width: 20px;
        height: 2px;
        background: #2d3748;
        margin: 2px 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 2px;
        transform-origin: center;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(3px, -3px);
    }
    
    /* Enhanced Hero Section */
    .article-hero {
        padding: 100px 0 60px;
        position: relative;
        overflow: hidden;
        min-height: 50vh;
        display: flex;
        align-items: center;
    }
    
    .article-hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.1);
        z-index: 1;
    }
    
    .article-hero .container {
        position: relative;
        z-index: 2;
        text-align: center;
        padding: 0 20px;
    }
    
    .article-hero h1 {
        font-size: 2.5rem;
        font-weight: 800;
        line-height: 1.2;
        margin-bottom: 1rem;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        animation: fadeInUp 0.8s ease-out;
    }
    
    .article-hero p {
        font-size: 1.1rem;
        line-height: 1.6;
        opacity: 0.95;
        max-width: 500px;
        margin: 0 auto;
        animation: fadeInUp 0.8s ease-out 0.2s both;
    }
    
    /* Content Layout Enhancements */
    .article-content {
        padding: 50px 20px;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .content-section {
        margin-bottom: 50px;
        animation: fadeInUp 0.6s ease-out;
    }
    
    .content-section h2 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 20px;
        padding-bottom: 10px;
        position: relative;
        color: #2d3748;
    }
    
    .content-section h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 50px;
        height: 3px;
        background: linear-gradient(90deg, #667eea, #764ba2);
        border-radius: 2px;
    }
    
    .content-section h3 {
        font-size: 1.4rem;
        font-weight: 600;
        margin: 25px 0 15px;
        color: #4a5568;
    }
    
    .content-section p {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 18px;
        color: #4a5568;
    }
    
    /* Enhanced Bird Images */
    .bird-image {
        width: 100%;
        height: 220px;
        object-fit: cover;
        border-radius: 16px;
        margin: 25px auto;
        display: block;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        transition: all 0.4s ease;
        position: relative;
        overflow: hidden;
    }
    
    .bird-image::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
    }
    
    .bird-image:active::before {
        opacity: 1;
    }
    
    .bird-image:active {
        transform: scale(1.02);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    }
    
    /* Enhanced Card Layouts */
    .beginner-grid,
    .journal-grid,
    .ethics-grid,
    .song-grid,
    .behavior-grid,
    .technique-grid,
    .location-grid,
    .season-grid,
    .equipment-grid,
    .identification-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 30px 0;
    }
    
    /* Enhanced Card Styles */
    .beginner-card,
    .journal-card,
    .ethics-card,
    .song-card,
    .behavior-card,
    .technique-card,
    .location-card,
    .season-card,
    .equipment-card,
    .identification-card {
        background: white;
        padding: 25px;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }
    
    .beginner-card::before,
    .journal-card::before,
    .ethics-card::before,
    .song-card::before,
    .behavior-card::before,
    .technique-card::before,
    .location-card::before,
    .season-card::before,
    .equipment-card::before,
    .identification-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #667eea, #764ba2);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.3s ease;
    }
    
    .beginner-card:active,
    .journal-card:active,
    .ethics-card:active,
    .song-card:active,
    .behavior-card:active,
    .technique-card:active,
    .location-card:active,
    .season-card:active,
    .equipment-card:active,
    .identification-card:active {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
    
    .beginner-card:active::before,
    .journal-card:active::before,
    .ethics-card:active::before,
    .song-card:active::before,
    .behavior-card:active::before,
    .technique-card:active::before,
    .location-card:active::before,
    .season-card:active::before,
    .equipment-card:active::before,
    .identification-card:active::before {
        transform: scaleX(1);
    }
    
    .beginner-card h4,
    .journal-card h4,
    .ethics-card h4,
    .song-card h4,
    .behavior-card h4,
    .technique-card h4,
    .location-card h4,
    .season-card h4,
    .equipment-card h4,
    .identification-card h4 {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 15px;
        color: #2d3748;
    }
    
    .beginner-card p,
    .journal-card p,
    .ethics-card p,
    .song-card p,
    .behavior-card p,
    .technique-card p,
    .location-card p,
    .season-card p,
    .equipment-card p,
    .identification-card p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #4a5568;
        margin: 0;
    }
    
    /* Enhanced Icons */
    .beginner-icon,
    .journal-icon,
    .ethics-icon,
    .song-icon,
    .behavior-icon,
    .technique-icon,
    .season-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
        display: block;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }
    
    /* Enhanced Special Sections */
    .step-by-step,
    .observation-guide,
    .activity-timeline,
    .feature-comparison,
    .settings-table,
    .frequency-chart,
    .threat-assessment {
        background: #f8fafc;
        padding: 25px;
        margin: 25px 0;
        border-radius: 16px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .step-item,
    .behavior-sequence,
    .timeline-item,
    .threat-item {
        background: white;
        padding: 20px;
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        display: flex;
        align-items: flex-start;
        gap: 15px;
        transition: all 0.3s ease;
    }
    
    .step-item:active,
    .behavior-sequence:active,
    .timeline-item:active,
    .threat-item:active {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .step-number,
    .sequence-step,
    .timeline-month,
    .threat-severity {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1rem;
        color: white;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    
    .step-content,
    .sequence-content,
    .timeline-content,
    .threat-content {
        flex: 1;
    }
    
    .step-content h5,
    .sequence-content h5,
    .timeline-content h5,
    .threat-content h5 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 8px;
        color: #2d3748;
    }
    
    .step-content p,
    .sequence-content p,
    .timeline-content p,
    .threat-content p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #4a5568;
        margin: 0;
    }
    
    /* Enhanced Highlight Boxes */
    .encouragement-box,
    .conservation-highlight,
    .species-highlight,
    .pro-tip,
    .template-section,
    .learning-technique,
    .insight-box {
        padding: 25px;
        margin: 25px 0;
        border-radius: 16px;
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .encouragement-box::before,
    .conservation-highlight::before,
    .species-highlight::before,
    .pro-tip::before,
    .template-section::before,
    .learning-technique::before,
    .insight-box::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: -1;
    }
    
    .encouragement-box h4,
    .conservation-highlight h4,
    .species-highlight h4,
    .pro-tip h4,
    .template-section h4,
    .learning-technique h4,
    .insight-box h4 {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 15px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    /* Enhanced Lists and Tips */
    .quick-tips,
    .mistake-warning,
    .tips-box,
    .tips-list,
    .tips-highlight,
    .checklist {
        padding: 20px;
        margin: 20px 0;
        border-radius: 12px;
        border-left: 4px solid;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .quick-tips {
        border-left-color: #4fd1c7;
        background: #e6fffa;
    }
    
    .mistake-warning {
        border-left-color: #fc8181;
        background: #fff5f5;
    }
    
    .tips-box,
    .tips-list,
    .checklist {
        border-left-color: #667eea;
        background: #f7fafc;
    }
    
    .quick-tips h4,
    .mistake-warning h4,
    .tips-box h4,
    .tips-list h4,
    .checklist h5 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 15px;
        color: #2d3748;
    }
    
    .quick-tips ul,
    .mistake-warning ul,
    .tips-box ul,
    .tips-list ul,
    .checklist ul {
        margin: 0;
        padding-left: 20px;
    }
    
    .quick-tips li,
    .mistake-warning li,
    .tips-box li,
    .tips-list li,
    .checklist li {
        margin-bottom: 10px;
        font-size: 0.95rem;
        line-height: 1.6;
        color: #4a5568;
    }
    
    /* Enhanced Footer */
    .footer {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: white;
        padding: 40px 0 25px;
        margin-top: 50px;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 30px;
        text-align: center;
        padding: 0 20px;
    }
    
    .footer-section h3,
    .footer-section h4 {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 15px;
        color: white;
    }
    
    .footer-section ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .footer-section li {
        margin: 10px 0;
    }
    
    .footer-section a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        padding: 8px 15px;
        border-radius: 20px;
        transition: all 0.3s ease;
        display: inline-block;
        font-size: 0.95rem;
    }
    
    .footer-section a:hover,
    .footer-section a:active {
        color: white;
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-2px);
    }
    
    .footer-bottom {
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        text-align: center;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.7);
        margin: 0;
    }
    
    /* Animations */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* Scroll animations */
    .content-section {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.6s ease;
    }
    
    .content-section.animate {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .article-hero h1 {
        font-size: 2rem;
    }
    
    .article-hero p {
        font-size: 1rem;
    }
    
    .content-section h2 {
        font-size: 1.6rem;
    }
    
    .bird-image {
        height: 200px;
    }
    
    .article-content {
        padding: 40px 15px;
    }
    
    .nav-menu {
        width: 90%;
    }
}

/* Performance optimizations */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .bird-image,
    .beginner-card,
    .journal-card,
    .ethics-card,
    .song-card,
    .behavior-card,
    .technique-card,
    .location-card,
    .season-card,
    .equipment-card,
    .identification-card {
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}