/* ========================================
   TAMIL NEWS PORTAL - RESPONSIVE STYLES
   Mobile First Approach
   ======================================== */

/* ========== EXTRA LARGE DEVICES (1400px and up) ========== */
@media (min-width: 1400px) {
    :root {
        --container-max: 1320px;
    }
    
    .hero-slides {
        height: 550px;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    /* Main News Grid - 4 columns */
    .main-news-section .news-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

/* ========== LARGE DEVICES (1200px - 1399px) ========== */
@media (max-width: 1399px) {
    :root {
        --container-max: 1140px;
    }
    
    /* Main News Grid - 4 columns */
    .main-news-section .news-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .main-news-section .card-image {
        height: 140px;
    }
    
    .main-news-section .card-title {
        font-size: 14px;
    }
    
    .main-news-section .news-card.featured {
        grid-column: span 1;
    }
    
    .main-news-section .news-card.featured .card-image {
        height: 140px;
        min-height: auto;
    }
    
    .main-news-section .news-card.featured .card-title {
        font-size: 14px;
    }
}

/* ========== MEDIUM-LARGE DEVICES (992px - 1199px) ========== */
@media (max-width: 1199px) {
    :root {
        --container-max: 960px;
    }
    
    /* Hero */
    .hero-slides {
        height: 450px;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .hero-thumbnails {
        display: none;
    }
    
    /* News Grid - Default */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-card.featured {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .news-card.featured .card-image {
        min-height: 300px;
    }
    
    /* Main News Grid - 3 columns */
    .main-news-section .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .main-news-section .card-image {
        height: 130px;
    }
    
    .main-news-section .news-card.featured {
        grid-column: span 1;
    }
    
    .main-news-section .news-card.featured .card-image {
        height: 130px;
        min-height: auto;
    }
    
    .main-news-section .card-content {
        padding: 14px;
    }
    
    .main-news-section .card-title {
        font-size: 13px;
    }
    
    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Weather */
    .weather-main {
        flex-direction: column;
        text-align: center;
    }
    
    .weather-stats {
        justify-content: center;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .footer-about {
        grid-column: span 3;
        margin-bottom: var(--spacing-xl);
    }
}

/* ========== MEDIUM DEVICES / TABLETS (768px - 991px) ========== */
@media (max-width: 991px) {
    :root {
        --container-max: 720px;
        --container-padding: 1.5rem;
        --header-height-tablet: 70px;
    }
    
    /* === CRITICAL FIX: Body padding for fixed header === */
    body {
        padding-top: calc(var(--ticker-height, 40px) + var(--header-height-tablet, 70px));
    }
    
    /* Header */
    .header-search {
        display: none;
    }
    
    .mobile-search-btn {
        display: flex;
    }
    
    /* === FIXED: Main header positioning === */
    .main-header {
        position: fixed;
        top: var(--ticker-height, 40px);
        left: 0;
        right: 0;
        z-index: var(--z-fixed, 100);
        background: var(--bg-primary);
    }
    
    /* Navigation */
    .main-nav {
        position: fixed;
        top: calc(var(--ticker-height, 40px) + var(--header-height-tablet, 70px));
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
        z-index: var(--z-modal);
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .nav-menu {
        flex-direction: column;
        padding: var(--spacing-lg);
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link {
        padding: var(--spacing-md) 0;
        color: var(--text-primary);
        justify-content: flex-start;
    }
    
    .nav-link::before {
        display: none;
    }
    
    .nav-link:hover,
    .nav-item.active .nav-link {
        background: transparent;
        color: var(--primary-color);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-secondary);
        border-radius: var(--radius-md);
        margin-top: var(--spacing-sm);
        display: none;
    }
    
    .nav-item.dropdown-open .dropdown-menu {
        display: block;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* === FIXED: Hero section spacing === */
    .hero-section {
        margin-top: 0;
        padding-top: var(--spacing-lg);
    }
    
    /* Hero */
    .hero-slides {
        height: 400px;
    }
    
    .hero-content {
        padding: var(--spacing-lg);
    }
    
    .hero-title {
        font-size: var(--font-size-xl);
    }
    
    .hero-meta {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .hero-prev,
    .hero-next {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
    
    /* News Grid - Default */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .news-card.featured {
        grid-column: span 2;
    }
    
    .news-card.featured .card-image {
        min-height: 250px;
    }
    
    .news-card.featured .card-title {
        font-size: var(--font-size-xl);
    }
    
    /* Main News Grid - 3 columns */
    .main-news-section .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .main-news-section .card-image {
        height: 120px;
    }
    
    .main-news-section .news-card.featured {
        grid-column: span 1;
    }
    
    .main-news-section .news-card.featured .card-image {
        height: 120px;
        min-height: auto;
    }
    
    .main-news-section .news-card.featured .card-title {
        font-size: 13px;
    }
    
    .main-news-section .card-content {
        padding: 12px;
    }
    
    .main-news-section .card-title {
        font-size: 12px;
    }
    
    .main-news-section .card-meta span {
        font-size: 10px;
    }
    
    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Trending Grid */
    .trending-grid {
        grid-template-columns: 1fr;
    }
    
    /* Weather Forecast */
    .weather-forecast {
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
    }
    
    .forecast-day {
        min-width: 70px;
    }
    
    /* Newsletter */
    .newsletter-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-content {
        flex-direction: column;
    }
    
    .newsletter-form {
        max-width: 100%;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .footer-about {
        grid-column: span 2;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    /* Section Titles */
    .section-title {
        font-size: var(--font-size-lg);
    }
}

/* ========== SMALL DEVICES / LARGE PHONES (576px - 767px) ========== */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
        --ticker-height: 36px;
        --header-height-mobile: 60px;
    }
    
    /* === CRITICAL FIX: Body padding for mobile === */
    body {
        padding-top: calc(var(--ticker-height) + var(--header-height-mobile));
    }
    
    /* Typography */
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }
    
    /* Breaking News Ticker */
    .breaking-news-ticker {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: var(--z-fixed, 100);
    }
    
    .ticker-label {
        padding: 0 var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    .ticker-label span {
        display: none;
    }
    
    .ticker-label::after {
        width: 30px;
        right: -15px;
    }
    
    .ticker-item {
        font-size: var(--font-size-xs);
    }
    
    .ticker-controls {
        display: none;
    }
    
    /* === FIXED: Header Top - Hidden but space accounted for === */
    .header-top {
        display: none;
    }
    
    /* === FIXED: Main Header positioning === */
    .main-header {
        position: fixed;
        top: var(--ticker-height);
        left: 0;
        right: 0;
        z-index: var(--z-fixed, 100);
        background: var(--bg-primary);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Header Main */
    .header-main {
        padding: var(--spacing-md) 0;
        min-height: var(--header-height-mobile);
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }
    
    .logo-title {
        font-size: var(--font-size-lg);
    }
    
    .logo-subtitle {
        display: none;
    }
    
    /* Navigation */
    .main-nav {
        top: calc(var(--ticker-height) + var(--header-height-mobile));
    }
    
    /* === FIXED: Hero Section - Proper spacing === */
    .hero-section {
        margin-top: 0;
        padding-top: var(--spacing-md);
    }
    
    .hero-slider {
        border-radius: 0;
    }
    
    .hero-slides {
        height: 300px;
    }
    
    .hero-content {
        padding: var(--spacing-md);
    }
    
    .category-badge {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    .hero-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-meta {
        font-size: var(--font-size-xs);
    }
    
    .hero-dots {
        bottom: var(--spacing-md);
    }
    
    .hero-dot {
        width: 8px;
        height: 8px;
    }
    
    .hero-dot.active {
        width: 20px;
    }
    
    .hero-prev,
    .hero-next {
        display: none;
    }
    
    /* Ad Slider */
    .ad-slider-section {
        padding: var(--spacing-md) 0;
    }
    
    .ad-slider {
        border-radius: var(--radius-md);
    }
    
    .ad-slides {
        height: 80px;
    }
    
    .ad-nav {
        width: 30px;
        height: 30px;
        font-size: var(--font-size-sm);
    }
    
    /* Section Header */
    .section-header {
        margin-bottom: var(--spacing-lg);
    }
    
    .section-title-wrapper {
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .section-title {
        font-size: var(--font-size-base);
    }
    
    .title-decoration {
        width: 8px;
        height: 8px;
    }
    
    .title-decoration.top-left,
    .title-decoration.bottom-left {
        left: -4px;
    }
    
    .title-decoration.top-right,
    .title-decoration.bottom-right {
        right: -4px;
    }
    
    .title-decoration.top-left,
    .title-decoration.top-right {
        top: -4px;
    }
    
    .title-decoration.bottom-left,
    .title-decoration.bottom-right {
        bottom: -4px;
    }
    
    .more-link {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    /* News Grid - Default - Single Column */
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .news-card.featured {
        grid-column: span 1;
    }
    
    .news-card.featured .card-image {
        min-height: 200px;
    }
    
    .news-card.featured .card-title {
        font-size: var(--font-size-lg);
    }
    
    .news-card.featured .card-content {
        padding: var(--spacing-md);
    }
    
    .card-image img {
        height: 180px;
    }
    
    .card-content {
        padding: var(--spacing-md);
    }
    
    .card-title {
        font-size: var(--font-size-base);
    }
    
    .card-actions {
        opacity: 1;
        transform: translateX(0);
        flex-direction: row;
        top: auto;
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
    
    /* ========== MAIN NEWS GRID - 2 COLUMNS ON MOBILE ========== */
    .main-news-section .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .main-news-section .card-image {
        height: 110px;
    }
    
    .main-news-section .news-card {
        border-radius: 16px;
    }
    
    .main-news-section .card-image img {
        border-radius: 16px 16px 0 0;
        height: 100%;
    }
    
    .main-news-section .news-card.featured {
        grid-column: span 1;
    }
    
    .main-news-section .news-card.featured .card-image {
        height: 110px;
        min-height: auto;
    }
    
    .main-news-section .news-card.featured .card-title {
        font-size: 12px;
    }
    
    .main-news-section .news-card.featured .card-content {
        padding: 12px;
    }
    
    .main-news-section .card-content {
        padding: 12px;
    }
    
    .main-news-section .card-title {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .main-news-section .card-category {
        font-size: 9px;
        padding: 4px 8px;
        top: 10px;
        left: 10px;
    }
    
    .main-news-section .card-meta span {
        font-size: 10px;
    }
    
    .main-news-section .card-meta {
        gap: 8px;
        padding-top: 10px;
    }
    
    /* Category Grid - 2 columns */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .category-card {
        padding: var(--spacing-md);
        flex-direction: column;
        text-align: center;
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
        font-size: var(--font-size-lg);
    }
    
    .category-info h3 {
        font-size: var(--font-size-sm);
    }
    
    .category-arrow {
        display: none;
    }
    
    /* Weather Widget */
    .weather-widget {
        padding: var(--spacing-lg);
    }
    
    .weather-current {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .weather-icon-large {
        font-size: 3rem;
    }
    
    .temp-value {
        font-size: 3rem;
    }
    
    .weather-stats {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .stat-item {
        font-size: var(--font-size-xs);
    }
    
    .forecast-day {
        min-width: 60px;
        padding: var(--spacing-sm);
    }
    
    .day-name {
        font-size: 10px;
    }
    
    .forecast-day i {
        font-size: var(--font-size-base);
    }
    
    .day-temp {
        font-size: var(--font-size-sm);
    }
    
    /* Trending Section */
    .trending-column {
        padding: var(--spacing-md);
    }
    
    .trending-item {
        padding: var(--spacing-sm);
    }
    
    .trending-number {
        font-size: var(--font-size-lg);
        min-width: 30px;
    }
    
    .trending-thumb {
        width: 60px;
        height: 60px;
    }
    
    .trending-content h4 {
        font-size: var(--font-size-xs);
    }
    
    /* Latest News List */
    .latest-news-item {
        padding: var(--spacing-sm);
    }
    
    .latest-thumb {
        width: 100px;
        height: 75px;
    }
    
    .latest-title {
        font-size: var(--font-size-xs);
    }
    
    .latest-meta {
        font-size: 10px;
    }
    
    /* Tags */
    .tags-cloud {
        gap: var(--spacing-sm);
    }
    
    .tag-item {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    .tag-item.tag-lg {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* Newsletter */
    .newsletter-section {
        padding: var(--spacing-xl) 0;
    }
    
    .newsletter-wrapper {
        padding: var(--spacing-lg);
        border-radius: var(--radius-xl);
    }
    
    .newsletter-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-2xl);
    }
    
    .newsletter-text h3 {
        font-size: var(--font-size-lg);
    }
    
    .newsletter-text p {
        font-size: var(--font-size-sm);
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
        border-radius: var(--radius-lg);
    }
    
    .newsletter-form input[type="email"] {
        border-radius: var(--radius-lg);
    }
    
    .subscribe-btn {
        width: 100%;
        justify-content: center;
        margin: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    
    /* Footer */
    .footer-top {
        padding: var(--spacing-xl) 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-about {
        grid-column: span 1;
        text-align: center;
    }
    
    .footer-about .logo-wrapper {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-links ul li a {
        justify-content: center;
    }
    
    .footer-links ul li a:hover {
        padding-left: 0;
    }
    
    .contact-list li {
        justify-content: center;
        text-align: left;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    /* Sections */
    .news-section,
    .category-section,
    .weather-section,
    .trending-section,
    .latest-news-section,
    .tags-section {
        padding: var(--spacing-xl) 0;
    }
}

/* ========== EXTRA SMALL DEVICES (below 576px) ========== */
@media (max-width: 575px) {
    :root {
        --container-padding: 0.75rem;
        --header-height-xs: 55px;
    }
    
    /* === CRITICAL FIX: Extra small device body padding === */
    body {
        padding-top: calc(var(--ticker-height, 36px) + var(--header-height-xs));
    }
    
    /* === FIXED: Header height for extra small === */
    .header-main {
        min-height: var(--header-height-xs);
        padding: var(--spacing-sm) 0;
    }
    
    /* Hero */
    .hero-slides {
        height: 250px;
    }
    
    .hero-title {
        font-size: var(--font-size-base);
        -webkit-line-clamp: 2;
    }
    
    /* === FIXED: Hero section spacing for extra small === */
    .hero-section {
        padding-top: var(--spacing-sm);
    }
    
    /* ========== MAIN NEWS GRID - 2 COLUMNS ON SMALL MOBILE ========== */
    .main-news-section .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .main-news-section .card-image {
        height: 100px;
    }
    
    .main-news-section .news-card {
        border-radius: 14px;
    }
    
    .main-news-section .card-image img {
        border-radius: 14px 14px 0 0;
    }
    
    .main-news-section .card-category {
        font-size: 8px;
        padding: 3px 6px;
        top: 8px;
        left: 8px;
        border-radius: 8px;
    }
    
    .main-news-section .card-content {
        padding: 10px;
    }
    
    .main-news-section .card-title {
        font-size: 11px;
        margin-bottom: 6px;
        line-height: 1.35;
    }
    
    .main-news-section .card-meta {
        gap: 6px;
        padding-top: 8px;
    }
    
    .main-news-section .card-meta span {
        font-size: 9px;
    }
    
    .main-news-section .news-card.featured {
        grid-column: span 1;
    }
    
    .main-news-section .news-card.featured .card-image {
        height: 100px;
        min-height: auto;
    }
    
    .main-news-section .news-card.featured .card-title {
        font-size: 11px;
    }
    
    .main-news-section .news-card.featured .card-content {
        padding: 10px;
    }
    
    /* Category Grid */
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }
    
    .category-card {
        padding: var(--spacing-sm);
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
    
    .category-info h3 {
        font-size: var(--font-size-xs);
    }
    
    .category-info span {
        font-size: 10px;
    }
    
    /* Latest News */
    .latest-thumb {
        width: 80px;
        height: 60px;
    }
    
    /* Weather */
    .weather-forecast {
        justify-content: flex-start;
    }
    
    .forecast-day {
        min-width: 50px;
    }
    
    /* Trending */
    .trending-thumb {
        width: 50px;
        height: 50px;
    }
    
    .trending-number {
        display: none;
    }
}

/* ========== EXTRA EXTRA SMALL DEVICES (below 400px) ========== */
@media (max-width: 400px) {
    /* Main News Grid - 2 columns still */
    .main-news-section .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .main-news-section .card-image {
        height: 85px;
    }
    
    .main-news-section .news-card {
        border-radius: 12px;
    }
    
    .main-news-section .card-image img {
        border-radius: 12px 12px 0 0;
    }
    
    .main-news-section .card-category {
        font-size: 7px;
        padding: 2px 5px;
        top: 6px;
        left: 6px;
    }
    
    .main-news-section .card-content {
        padding: 8px;
    }
    
    .main-news-section .card-title {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .main-news-section .card-meta {
        gap: 4px;
        padding-top: 6px;
    }
    
    .main-news-section .card-meta span {
        font-size: 8px;
    }
    
    .main-news-section .card-meta span i {
        font-size: 8px;
    }
}

/* ========== LANDSCAPE ORIENTATION ========== */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --header-height-landscape: 50px;
    }
    
    /* === FIXED: Landscape body padding === */
    body {
        padding-top: calc(var(--ticker-height, 36px) + var(--header-height-landscape));
    }
    
    .hero-slides {
        height: 60vh;
    }
    
    .main-header {
        position: fixed;
        top: var(--ticker-height, 36px);
    }
    
    .header-main {
        min-height: var(--header-height-landscape);
        padding: var(--spacing-xs) 0;
    }
    
    .main-nav {
        top: calc(var(--ticker-height, 36px) + var(--header-height-landscape));
    }
    
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .nav-item {
        width: auto;
        border-bottom: none;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    /* Hide non-essential elements */
    .breaking-news-ticker,
    .main-header,
    .hero-nav,
    .hero-dots,
    .hero-thumbnails,
    .ad-slider-section,
    .card-actions,
    .newsletter-section,
    .back-to-top,
    .main-footer {
        display: none !important;
    }
    
    /* === FIXED: Reset body padding for print === */
    body {
        padding-top: 0 !important;
    }
    
    /* Reset colors */
    body {
        background: #ffffff;
        color: #000000;
    }
    
    .news-card,
    .category-card,
    .weather-widget,
    .trending-column {
        box-shadow: none;
        border: 1px solid #cccccc;
    }
    
    /* Ensure links are visible */
    a {
        color: #000000;
        text-decoration: underline;
    }
    
    /* Show URLs */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    /* Avoid page breaks inside cards */
    .news-card,
    .trending-item,
    .latest-news-item {
        page-break-inside: avoid;
    }
    
    /* Main News Grid for Print */
    .main-news-section .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #ff0000;
        --text-primary: #000000;
        --text-secondary: #333333;
        --bg-primary: #ffffff;
        --border-color: #000000;
    }
    
    [data-theme="dark"] {
        --primary-color: #ff6666;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --bg-primary: #000000;
        --border-color: #ffffff;
    }
    
    .news-card,
    .category-card,
    .trending-column {
        border: 2px solid var(--border-color);
    }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link {
        min-height: 48px;
    }
    
    .action-btn {
        width: 44px;
        height: 44px;
    }
    
    .tag-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remove hover effects that don't work on touch */
    .news-card:hover {
        transform: none;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .card-actions {
        opacity: 1;
        transform: none;
    }
    
    /* Main News Cards - No transform on touch */
    .main-news-section .news-card:hover {
        transform: none;
    }
}

/* ========== DARK MODE SPECIFIC RESPONSIVE ========== */
[data-theme="dark"] {
    /* Adjust image brightness in dark mode */
    .hero-image img,
    .card-image img,
    .trending-thumb img,
    .latest-thumb img {
        filter: brightness(0.9);
    }
    
    /* Skeleton loading in dark mode */
    .skeleton {
        background: linear-gradient(
            90deg,
            var(--bg-secondary) 25%,
            var(--bg-tertiary) 50%,
            var(--bg-secondary) 75%
        );
    }
    
    /* Main News Cards Dark Mode */
    .main-news-section .news-card {
        background: var(--bg-primary);
    }
}

/* ========== SAFE AREA FOR NOTCHED DEVICES (iPhone X+) ========== */
@supports (padding: max(0px)) {
    @media (max-width: 767px) {
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
        
        .main-header {
            padding-left: max(var(--container-padding), env(safe-area-inset-left));
            padding-right: max(var(--container-padding), env(safe-area-inset-right));
        }
        
        .breaking-news-ticker {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-slide {
        transition: none;
    }
    
    .news-card:hover,
    .main-news-section .news-card:hover {
        transform: none;
    }
}