/* ===========================================
   FANTASY FOOTBALL NERDS - MAIN STYLES
   =========================================== */

/* ===========================================
   RESPONSIVE BREAKPOINT STANDARDS
   =========================================== */
/* 
STANDARDIZED BREAKPOINTS (Tailwind Compatible):
- sm: 640px and up (small tablets, large phones in landscape)
- md: 768px and up (medium tablets, small laptops)  
- lg: 1024px and up (large tablets, laptops)
- xl: 1280px and up (desktops)
- 2xl: 1536px and up (large desktops)

MOBILE-FIRST APPROACH:
- Base styles: Mobile (up to 639px)
- @media (max-width: 480px): Very small phones
- @media (max-width: 639px): Mobile only
- @media (max-width: 767px): Mobile + small tablets
- @media (min-width: 640px): Small tablets and up
- @media (min-width: 768px): Medium tablets and up
- @media (min-width: 1024px): Laptops and up
- @media (min-width: 1280px): Desktops and up

TOUCH-SPECIFIC:
- @media (hover: none) and (pointer: coarse): Touch devices
- @media (hover: hover) and (pointer: fine): Mouse/trackpad devices

ACCESSIBILITY:
- @media (prefers-reduced-motion: reduce): Reduced motion preference
- @media (prefers-contrast: high): High contrast preference
- @supports (-webkit-touch-callout: none): iOS Safari specific

PRINT:
- @media print: Print-specific styles
*/

/* Base styles */
:root {
    --primary-color: #38b6ff;
    --secondary-color: #ff6347;
    --background-color: #f8f9fa;
    --text-color: #333;
    --header-color: #0e2240;
    --footer-color: #0e2240;
    --white: #fff;
    --gray-100: #f8f9fa;
    --gray-200: #f0f0f0;
    --gray-300: #e9ecef;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #555;
    --gray-800: #343a40;
    --gray-900: #212529;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Expert Profile Picture Styles */
.expert-pfp {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1e40af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.expert-pfp:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: #3b82f6;
}

.expert-pfp.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.expert-pfp.large {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Expert header with profile */
.expert-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.expert-header:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.expert-header .expert-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.expert-header .expert-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #1e40af;
    margin: 0;
    line-height: 1.2;
}

.expert-header .expert-title {
    font-size: 0.85em;
    color: #64748b;
    font-style: italic;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

/* Enhanced profile picture for main page */
.expert-header .expert-pfp {
    width: 48px;
    height: 48px;
    border-width: 3px;
    border-color: #1e40af;
    flex-shrink: 0;
}

.expert-header .expert-pfp:hover {
    transform: scale(1.05);
    border-color: #3b82f6;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .expert-header {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .expert-header .expert-pfp {
        width: 40px;
        height: 40px;
    }
    
    .expert-header .expert-name {
        font-size: 1em;
    }
    
    .expert-header .expert-title {
        font-size: 0.8em;
    }
}

/* Rankings page expert selector */
.expert-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
}

.expert-selector .expert-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.expert-selector .expert-option:hover {
    background: #e2e8f0;
}

.expert-selector .expert-option.active {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}

.expert-selector .expert-option.active .expert-pfp {
    border-color: white;
}

/* Consensus indicator */
.consensus-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 8px;
    color: white;
    font-weight: 600;
    margin-bottom: 12px;
}

.consensus-indicator::before {
    content: "🏆";
    font-size: 1.2em;
}

/* Featured Player Images */
.featured-player-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 32px 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.featured-player-img {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .featured-player-img {
        max-width: 250px;
        max-height: 160px;
    }
    
    .featured-player-section {
        padding: 24px 16px;
        margin: 24px 0;
    }
}

/* Dropdown menu styling override */
#weekly-analysis-menu a,
#tools-menu a,
.week-section a {
    color: #212529 !important;
}

#weekly-analysis-menu a:hover,
#tools-menu a:hover,
.week-section a:hover {
    color: #212529 !important;
    background-color: #f8f9fa;
}

/* Additional specificity for dynamically created elements */
div[id="weekly-analysis-menu"] a,
div[id="tools-menu"] a {
    color: #212529 !important;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
}

/* Player rankings styling */
.player-team {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* Header */
.site-header {
    background-color: var(--header-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    max-width: 200px;
    height: auto;
}

.nav-menu {
    display: flex;
    list-style-type: none;
}

.nav-menu li {
    margin-left: 1.5rem;
}

.nav-menu li a {
    color: var(--text-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Main content */
.main-content {
    margin-top: 80px;
    padding: 2rem 5%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero section */
.hero-section {
    background-image: url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--header-color);
    text-align: center;
    padding: 6rem 0;
    margin-bottom: 4rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Featured article */
.featured-article {
    display: flex;
    background-color: var(--header-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 4rem;
}

.featured-article .article-image {
    width: 50%;
    object-fit: cover;
}

.featured-article .article-content {
    width: 50%;
    padding: 2rem;
}

.featured-article h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Article grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.article-card {
    background-color: var(--header-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card .article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card .article-content {
    padding: 1.5rem;
}

.article-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Section styles */
.featured-section,
.latest-section,
.analysis-section,
.depth-chart-section,
.about-section {
    margin-bottom: 4rem;
}

/* Weekly analysis menu */
#weekly-analysis-menu {
    background-color: var(--header-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Button styles */
.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--header-color);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: var(--secondary-color);
}

/* Footer */
.site-footer {
    background-color: var(--footer-color);
    color: var(--header-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.footer-section {
    flex: 1;
    margin-right: 2rem;
}

.footer-section:last-child {
    margin-right: 0;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style-type: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links img {
    width: 24px;
    height: 24px;
}

.newsletter-form {
    display: flex;
    margin-top: 1rem;
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 5px 0 0 5px;
}

.newsletter-form .button {
    border-radius: 0 5px 5px 0;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Index Page Specific Styles */
.site-title {
    text-align: center;
    padding: 80px 0 60px;
    font-size: 72px;
    font-weight: 900;
    color: var(--header-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .site-title {
        font-size: 48px;
        padding: 60px 0 40px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 36px;
        padding: 40px 0 30px;
        letter-spacing: 1px;
    }
}

.site-title:after {
    content: "";
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.article-cluster {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    margin-bottom: 30px;
}

.article-box {
    position: relative;
    background-color: var(--white);
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.article-box:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.article-box.featured {
    grid-column: 1 / 3;
    height: 400px;
}

.article-box.secondary {
    height: 250px;
}

.article-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7) 60%, transparent);
    color: white;
    padding: 20px;
}

.featured .article-overlay {
    padding: 30px;
}

.article-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.article-title {
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.featured .article-title {
    font-size: 24px;
}

.secondary .article-title {
    font-size: 18px;
}

.article-excerpt {
    margin-bottom: 10px;
    font-size: 14px;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured .article-excerpt {
    -webkit-line-clamp: 3;
}

.article-date {
    font-size: 12px;
    opacity: 0.8;
}

.archive-button {
    display: block;
    text-align: center;
    margin: 30px auto;
    padding: 12px 25px;
    background-color: var(--header-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    width: 260px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.archive-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.rankings-section {
    margin-top: 60px;
}

.rankings-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--header-color);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.rankings-title:after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

.ppr-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.ppr-button {
    padding: 12px 20px;
    margin: 0 5px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    border-radius: 6px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    flex: 1;
    text-align: center;
    min-height: 44px;
    min-width: 44px;
}

.ppr-button:hover {
    color: var(--header-color);
    background-color: var(--gray-100);
}

.ppr-button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(56, 182, 255, 0.3);
}

.position-toggle {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.position-button {
    padding: 15px 20px;
    margin: 0 5px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    border-radius: 5px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    min-height: 44px;
    min-width: 44px;
}

.position-button:hover {
    color: var(--header-color);
}

.position-button.active {
    background-color: var(--header-color);
    color: white;
}

.rankings {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.ranking-column {
    width: 30%;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
}

.expert-name {
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--header-color);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-200);
    position: relative;
}

.expert-name:after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.player-list {
    list-style: none;
}

.player-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.player-list li:hover {
    background-color: var(--gray-100);
    padding-left: 5px;
}

.player-rank {
    width: 30px;
    font-weight: 700;
    color: var(--header-color);
    font-size: 16px;
}

.see-full-list {
    text-align: center;
    padding: 15px 0;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s ease;
}

.see-full-list:hover {
    color: var(--header-color);
    text-decoration: underline;
}


.more-articles-header {
    text-align: center;
    margin: 40px 0 30px 0;
}

.more-articles-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--header-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    margin-bottom: 0;
}

.more-articles-header h2:after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.bottom-articles {
    margin-bottom: 40px;
}

.bottom-article {
    background-color: white;
    margin-bottom: 20px;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    position: relative;
    overflow: hidden;
}

.bottom-article:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-color);
}

.bottom-article h3 {
    margin-bottom: 15px;
    color: var(--header-color);
    font-size: 20px;
}

.bottom-article p {
    color: var(--gray-700);
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    .nav-menu {
        margin-top: 1rem;
    }

    .featured-article {
        flex-direction: column;
    }

    .featured-article .article-image,
    .featured-article .article-content {
        width: 100%;
    }

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

    .footer-section {
        margin-right: 0;
        margin-bottom: 2rem;
    }

    .article-cluster {
        grid-template-columns: 1fr;
    }

    .article-box.featured {
        grid-column: 1;
        height: 300px;
    }

    .rankings {
        flex-direction: column;
    }

    .ranking-column {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Mobile-optimized touch targets */
    .ppr-button,
    .position-button {
        padding: 16px 20px;
        margin: 0 2px;
        font-size: 16px;
    }

    /* Mobile typography improvements */
    body {
        line-height: 1.7;
    }

    .article-excerpt {
        line-height: 1.8;
    }

    /* Better mobile spacing */
    .container {
        padding: 0 16px;
    }

    .rankings-section {
        padding: 0 8px;
    }
}

/* Mobile Table Typography Enhancements */
@media (max-width: 768px) {
    /* Ensure all tables have good mobile typography */
    table {
        font-size: 14px;
        line-height: 1.4;
    }
    
    table th {
        font-size: 12px;
        font-weight: 600;
        padding: 12px 8px;
        white-space: nowrap;
    }
    
    table td {
        padding: 10px 8px;
        line-height: 1.3;
    }
    
    /* Player names and important content */
    .player-name,
    .team-cell {
        font-size: 14px;
        font-weight: 600;
    }
    
    /* Rankings and numbers */
    .font-bold {
        font-weight: 700;
    }
    
    /* Improve readability of small text */
    .text-sm {
        font-size: 13px;
    }
    
    .text-xs {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 12px;
    }
    
    table th {
        font-size: 11px;
        padding: 10px 6px;
    }
    
    table td {
        padding: 8px 6px;
    }
    
    .player-name,
    .team-cell {
        font-size: 13px;
    }
    
    .text-sm {
        font-size: 12px;
    }
    
    .text-xs {
        font-size: 11px;
    }
}

/* Sticky Header Mobile Enhancements */
@media (max-width: 768px) {
    /* Ensure proper z-index stacking on mobile */
    .site-header,
    header[class*="fixed"] {
        z-index: 1000;
    }
    
    /* Table sticky headers should be below site header */
    .rankings-table th[style*="sticky"],
    .defense-rankings-table th,
    table th[class*="sticky"] {
        z-index: 10;
    }
    
    /* Mobile sticky table improvements */
    .table-container {
        position: relative;
        max-height: calc(100vh - 200px);
    }
    
    /* Ensure dropdown menus work properly on mobile */
    .dropdown__menu,
    #weekly-analysis-menu,
    #tools-menu {
        z-index: 999;
    }
    
    /* Mobile menu overlay */
    #mobile-menu {
        z-index: 1001;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix sticky header positioning in iOS Safari */
    .rankings-table th,
    .defense-rankings-table th {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Touch Target Audit & Fixes */
/* Ensure ALL interactive elements meet 44px minimum touch target */
@media (max-width: 768px) {
    /* Buttons and form controls */
    button,
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    .btn,
    .filter-btn,
    .ppr-button,
    .position-button,
    .view-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 12px 16px;
    }
    
    /* Links in navigation and dropdowns */
    nav a,
    .nav-link,
    .dropdown__item,
    .mobile-menu a,
    #weekly-analysis-menu a,
    #tools-menu a {
        min-height: 44px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
    }
    
    /* Table headers that are sortable/clickable */
    table th.sortable,
    .rankings-table th.sortable,
    .defense-rankings-table th.sortable {
        min-width: 44px;
        min-height: 44px;
        padding: 12px 8px;
    }
    
    /* Mobile menu toggle */
    #mobile-menu-toggle,
    #mobile-menu-close {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    /* Logo/brand links */
    .logo a,
    header a[href="/"] {
        min-height: 44px;
        padding: 8px 0;
    }
    
    /* Expert profile pictures when clickable */
    .expert-pfp {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Archive and read more buttons */
    .archive-button,
    .read-more,
    .see-full-list {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    /* Form inputs */
    input[type="text"],
    input[type="email"],
    input[type="search"],
    select,
    textarea {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Player cards when clickable */
    .player-card[role="button"],
    .player-card.clickable,
    .article-card {
        min-height: 44px;
    }
    
    /* Dropdown triggers */
    .dropdown__trigger,
    button[aria-haspopup="true"] {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 12px;
    }
}

/* Component Stacking & Spacing Improvements */
@media (max-width: 768px) {
    /* Filter container improvements */
    .filter-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        margin-bottom: 24px !important;
    }
    
    .filter-group {
        flex-wrap: wrap !important;
        gap: 12px !important;
        justify-content: center !important;
    }
    
    /* Button group spacing */
    .ppr-toggle,
    .position-toggle {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px !important;
        justify-content: center !important;
    }
    
    /* Card grid improvements */
    .article-grid,
    .defense-detailed-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .article-cluster {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .article-box.featured {
        grid-column: 1 !important;
        height: auto !important;
        min-height: 200px !important;
    }
    
    /* Better spacing for sections */
    .featured-section,
    .latest-section,
    .analysis-section {
        margin-bottom: 32px !important;
        padding: 0 16px !important;
    }
    
    /* Improved layout for form elements */
    .newsletter-form {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .newsletter-form input[type="email"] {
        border-radius: 6px !important;
        margin-bottom: 12px !important;
    }
    
    .newsletter-form .button {
        border-radius: 6px !important;
        width: 100% !important;
    }
    
    /* Rankings layout improvements */
    .rankings {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .ranking-column {
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* Footer improvements */
    .footer-content {
        flex-direction: column !important;
        gap: 24px !important;
    }
    
    .footer-section {
        margin-right: 0 !important;
        margin-bottom: 24px !important;
    }
    
    /* Hero section adjustments */
    .hero-content h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    /* Improved spacing for content sections */
    main.header-spacing {
        padding-top: 140px !important;
    }
    
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

@media (max-width: 480px) {
    /* Even tighter spacing on very small screens */
    .filter-container,
    .ppr-toggle,
    .position-toggle {
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .filter-btn,
    .ppr-button,
    .position-button {
        flex: 1 1 calc(50% - 4px) !important;
        margin: 0 !important;
    }
    
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
    }
}

/* Mobile Navigation Enhancements */
@media (max-width: 768px) {
    /* Ensure mobile menu has smooth performance */
    #mobile-menu {
        will-change: transform;
        -webkit-transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    #mobile-menu:not(.translate-x-full) {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    /* Improve dropdown performance on mobile */
    .dropdown__menu,
    #weekly-analysis-menu,
    #tools-menu {
        will-change: opacity, transform;
        transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    }
    
    /* Better mobile menu spacing */
    #mobile-menu nav a {
        padding: 16px 0;
        font-size: 18px;
        border-bottom: 1px solid #f3f4f6;
    }
    
    #mobile-menu nav a:last-child {
        border-bottom: none;
    }
    
    /* Improve mobile dropdown styling */
    #mobile-weekly-analysis-dropdown a,
    #mobile-tools-dropdown a {
        padding: 12px 0 12px 16px;
        font-size: 16px;
        color: #6b7280;
    }
    
    /* Prevent layout shift when menu opens */
    body.overflow-hidden {
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }
    
    /* Ensure menu overlay works properly */
    #mobile-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease-out;
    }
    
    #mobile-menu:not(.translate-x-full)::before {
        opacity: 1;
    }
}

/* Mobile Image Optimization */
@media (max-width: 768px) {
    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Article and featured images */
    .article-image,
    .featured-article .article-image {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }
    
    .article-card .article-image {
        height: 150px;
        object-fit: cover;
    }
    
    /* Expert profile pictures */
    .expert-pfp {
        max-width: 40px;
        max-height: 40px;
        object-fit: cover;
        border-radius: 50%;
    }
    
    .expert-pfp.large {
        max-width: 48px;
        max-height: 48px;
    }
    
    /* Featured player images */
    .featured-player-img,
    .featured-player-section img {
        max-width: 250px;
        max-height: 160px;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    
    /* Logo optimization */
    .logo img,
    header img[alt*="Logo"] {
        max-height: 28px;
        width: auto;
        object-fit: contain;
    }
    
    /* Social media icons */
    .social-links img {
        width: 20px;
        height: 20px;
        object-fit: contain;
    }
    
    /* Team cell images if any */
    .team-cell img {
        max-width: 20px;
        max-height: 20px;
        object-fit: contain;
    }
    
    /* Optimize background images */
    .hero-section,
    .article-overlay {
        background-size: cover;
        background-position: center;
        background-attachment: scroll; /* Better performance on mobile */
    }
}

@media (max-width: 480px) {
    /* Even smaller images on very small screens */
    .article-card .article-image {
        height: 120px;
    }
    
    .featured-player-img {
        max-width: 200px;
        max-height: 120px;
    }
    
    .logo img {
        max-height: 24px;
    }
    
    .expert-pfp {
        max-width: 36px;
        max-height: 36px;
    }
}

/* Image loading optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded,
img:not([loading="lazy"]) {
    opacity: 1;
}

/* Prevent layout shift from images */
.article-image,
.featured-player-img,
.expert-pfp {
    background-color: #f3f4f6;
}

/* Advanced Mobile Optimizations */

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .article-box:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .ppr-button:hover,
    .position-button:hover {
        background-color: transparent;
        color: var(--gray-700);
    }

    .ppr-button.active:hover {
        background-color: var(--primary-color);
        color: white;
    }

    .position-button.active:hover {
        background-color: var(--header-color);
        color: white;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .article-box {
        border: 2px solid var(--text-color);
    }

    .ppr-button,
    .position-button {
        border: 1px solid var(--gray-400);
    }

    .ppr-button.active,
    .position-button.active {
        border: 2px solid var(--text-color);
    }
}

/* Improved mobile layout for smaller screens */
@media (max-width: 480px) {
    .ppr-toggle,
    .position-toggle {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .ppr-button,
    .position-button {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        margin: 0;
    }

    .rankings {
        gap: 16px;
    }

    .article-overlay {
        padding: 16px;
    }

    .featured .article-overlay {
        padding: 20px;
    }
}
