/* Mobile App Style - Colorful & Stylish Edition with Dark Mode */

/* Light Theme (Default) */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    --primary-color: #667eea;
    --secondary-color: #f5576c;
    --accent-color: #00f2fe;
    --border-color: #e8e8e8;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --skeleton-base: #e2e8f0;
    --skeleton-highlight: #f7fafc;
}

/* Dark Theme */
body.dark-mode {
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    --success-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);

    --primary-color: #8b5cf6;
    --secondary-color: #ec4899;
    --accent-color: #06b6d4;
    --border-color: #374151;
    --bg-white: #1f2937;
    --bg-gray: #111827;
    --bg-card: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --skeleton-base: #374151;
    --skeleton-highlight: #4b5563;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Telugu', 'Poppins', sans-serif;
    background: var(--bg-gray);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode transitions for all elements */
body.dark-mode * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Mobile App Header - Colorful Gradient */
.mobile-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-gradient);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    height: 56px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-right: 8px;
}

.mobile-app-header .logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
}

.mobile-app-header .notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-app-header .notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.mobile-app-header .notification-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--secondary-gradient);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.5);
}

/* Category Tabs - Colorful Pills */
.category-tabs-wrapper {
    position: sticky;
    top: 56px;

    z-index: 20;          /* 👈 HIGHER than breaking news */
    background: #fff;
}


.category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 10px 8px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf0 100%);
    border: 2px solid transparent;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-tab.active {
    color: white;
    background: #0C63D4 !important;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.category-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.add-category-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--success-gradient);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* News Card - Colorful & Modern */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.mobile-news-card {
    background: white;
    border-radius: 20px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.mobile-news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.mobile-news-card .card-image {
    width: 100%;
    height: 220px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.mobile-news-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.mobile-news-card:hover .card-image img {
    transform: scale(1.1);
}

.mobile-news-card .card-image .category-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--primary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mobile-news-card .card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 16px 18px 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Noto Sans Telugu', sans-serif;
}

.mobile-news-card .card-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 18px 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Noto Sans Telugu', sans-serif;
}

.mobile-news-card .read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--success-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0 18px 16px;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.mobile-news-card .read-more-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5);
}

.mobile-news-card .read-more-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.mobile-news-card .read-more-btn:hover i {
    transform: translateX(3px);
}

.mobile-news-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 18px 18px;
    padding-top: 16px;
    border-top: 2px solid #f0f0f0;
}

.mobile-news-card .meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mobile-news-card .source-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-news-card .source-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mobile-news-card .source-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 700;
}

.mobile-news-card .verified-badge {
    color: #1DA1F2;
    font-size: 14px;
    filter: drop-shadow(0 2px 4px rgba(29, 161, 242, 0.4));
}

.mobile-news-card .time-ago {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.mobile-news-card .meta-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-news-card .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 700;
}

.mobile-news-card .meta-item i {
    font-size: 16px;
}

.mobile-news-card .meta-item.comments i {
    color: #667eea;
}

.mobile-news-card .meta-item.shares i {
    color: #25D366;
}

/* Bottom Navigation - Colorful */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .nav-item i {
    font-size: 22px;
    transition: all 0.3s ease;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-bottom-nav .nav-item.active i {
    transform: scale(1.2);
}

/* Status Bar - Colorful */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    color: white;
    z-index: 1001;
    font-weight: 600;
}

.status-bar .status-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.status-bar .status-icons i {
    font-size: 10px;
}

/* Adjust positions */
.with-status-bar .mobile-app-header {
    top: 1px !important;
}

.with-status-bar .category-tabs-wrapper {
    top: 0px !important;
}

/* .with-status-bar .mobile-app-content {
    margin-top: 144px !important;
} */

/* Loading Spinner - Colorful */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (min-width: 768px) {

    .mobile-app-header,
    .category-tabs-wrapper,
    .mobile-bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

  .mobile-app-content {
    padding-top: 30px;   /* header + breaking bar */
}

}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hide desktop elements */
.top-header,
.main-header,
.search-bar,
.main-footer {
    display: none !important;
}

/* ===== ARTICLE DETAILS PAGE ===== */

/* Back Button in Header */
.mobile-app-header .back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-app-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.mobile-app-header .header-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-app-header .share-btn-header {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mobile-app-header .share-btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Article Detail Content */
.article-detail-content {
    margin-top: 80px;
    padding-bottom: 80px;
    background: white;
}

/* Hero Image - FIXED HEIGHT FOR MOBILE */
.article-hero-image {
    width: 100%;
    height: 250px;
    /* Fixed height to prevent portrait images from taking full screen */
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cover fills the area, cropping if necessary */
    object-position: center top;
    /* Focus on top part of image usually faces/important content */
}

.article-category-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: var(--primary-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

/* Article Body */
.article-body {
    padding: 20px;
}

.article-detail-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-family: 'Noto Sans Telugu', sans-serif;
}

/* Article Meta */
.article-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.publish-time {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.meta-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.meta-stats i {
    color: var(--primary-color);
}

/* Article Text Content */
.article-detail-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-family: 'Noto Sans Telugu', sans-serif;
    text-align: justify;
}

/* Share Section */
.article-share-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8eaf0 100%);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.article-share-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-family: 'Noto Sans Telugu', sans-serif;
}

.share-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 15px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn i {
    font-size: 18px;
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0C63D4 100%);
}

.share-btn.telegram {
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
}

.share-btn.copy {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.share-btn:active {
    transform: translateY(0);
}

/* Related Articles Section */
.related-articles-section {
    margin-top: 30px;
}

.related-articles-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    font-family: 'Noto Sans Telugu', sans-serif;
}

.related-articles-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-article-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 12px;
}

.related-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.related-image {
    width: 120px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-category {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.related-content h4 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Noto Sans Telugu', sans-serif;
}

.related-time {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* Responsive for Article Details */
@media (min-width: 768px) {
    .article-detail-content {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== RESPONSIVE IMAGES ===== */

/* Base responsive image rules */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Homepage News Cards - Responsive */
@media (max-width: 360px) {
    .mobile-news-card .card-image {
        height: 180px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .mobile-news-card .card-image {
        height: 220px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .mobile-news-card .card-image {
        height: 260px;
    }
}

@media (min-width: 769px) {
    .mobile-news-card .card-image {
        height: 280px;
    }
}

/* Article Hero Image - Responsive */
@media (max-width: 360px) {
    .article-hero-image {
        height: 200px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .article-hero-image {
        height: 250px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .article-hero-image {
        height: 300px;
    }
}

@media (min-width: 769px) {
    .article-hero-image {
        height: 350px;
    }
}

/* Related Articles Images - Responsive */
@media (max-width: 360px) {
    .related-image {
        width: 100px;
        height: 75px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .related-image {
        width: 120px;
        height: 90px;
    }
}

@media (min-width: 481px) {
    .related-image {
        width: 140px;
        height: 105px;
    }
}

/* Ensure all images maintain aspect ratio */
.mobile-news-card .card-image img,
.article-hero-image img,
.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Prevent image overflow */
.mobile-news-card,
.article-detail-content,
.related-article-card {
    overflow: hidden;
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-news-card .card-image {
        height: 160px;
    }

    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    font-family: 'Noto Sans Telugu',
    sans-serif;
}

.related-articles-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-article-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 12px;
}

.related-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.related-image {
    width: 120px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-category {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.related-content h4 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Noto Sans Telugu', sans-serif;
}

.related-time {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* Responsive for Article Details */
@media (min-width: 768px) {
    .article-detail-content {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== RESPONSIVE IMAGES ===== */

/* Base responsive image rules */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Homepage News Cards - Responsive */
@media (max-width: 360px) {
    .mobile-news-card .card-image {
        height: 180px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .mobile-news-card .card-image {
        height: 220px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .mobile-news-card .card-image {
        height: 260px;
    }
}

@media (min-width: 769px) {
    .mobile-news-card .card-image {
        height: 280px;
    }
}

/* Article Hero Image - Responsive */
@media (max-width: 360px) {
    .article-hero-image {
        height: 200px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .article-hero-image {
        height: 250px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .article-hero-image {
        height: 300px;
    }
}

@media (min-width: 769px) {
    .article-hero-image {
        height: 350px;
    }
}

/* Related Articles Images - Responsive */
@media (max-width: 360px) {
    .related-image {
        width: 100px;
        height: 75px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .related-image {
        width: 120px;
        height: 90px;
    }
}

@media (min-width: 481px) {
    .related-image {
        width: 140px;
        height: 105px;
    }
}

/* Ensure all images maintain aspect ratio */
.mobile-news-card .card-image img,
.article-hero-image img,
.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Prevent image overflow */
.mobile-news-card,
.related-article-card {
    overflow: hidden;
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-news-card .card-image {
        height: 160px;
    }
}

.related-articles-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-article-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 12px;
}

.related-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.related-image {
    width: 120px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-category {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.related-content h4 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    /* Standard line-clamp property */
    font-family: 'Noto Sans Telugu', sans-serif;
}

.related-time {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* Responsive for Article Details */
@media (min-width: 768px) {
    .article-detail-content {
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== RESPONSIVE IMAGES ===== */

/* Base responsive image rules */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Homepage News Cards - Responsive */
@media (max-width: 360px) {
    .mobile-news-card .card-image {
        height: 180px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .mobile-news-card .card-image {
        height: 220px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .mobile-news-card .card-image {
        height: 260px;
    }
}

@media (min-width: 769px) {
    .mobile-news-card .card-image {
        height: 280px;
    }
}

/* Article Hero Image - Responsive */
@media (max-width: 360px) {
    .article-hero-image {
        height: 200px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .article-hero-image {
        height: 250px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .article-hero-image {
        height: 300px;
    }
}

@media (min-width: 769px) {
    .article-hero-image {
        height: 350px;
    }
}

/* Related Articles Images - Responsive */
@media (max-width: 360px) {
    .related-image {
        width: 100px;
        height: 75px;
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .related-image {
        width: 120px;
        height: 90px;
    }
}

@media (min-width: 481px) {
    .related-image {
        width: 140px;
        height: 105px;
    }
}

/* Ensure all images maintain aspect ratio */
.mobile-news-card .card-image img,
.article-hero-image img,
.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Prevent image overflow */
.mobile-news-card,
.article-detail-content,
.related-article-card {
    overflow: hidden;
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-news-card .card-image {
        height: 160px;
    }

    .article-hero-image {
        height: 180px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .mobile-news-card .card-image img,
    .article-hero-image img,
    .related-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== PREMIUM READING FEATURES ===== */

/* 1. Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 56px;
    /* Below header */
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1002;
}

.reading-progress-bar {
    height: 4px;
    background: var(--success-gradient);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.4);
}

/* 2. Font Size Control */
.mobile-app-header .font-size-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 16px;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-right: 8px;
}

.mobile-app-header .font-size-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.font-size-menu {
    position: fixed;
    top: 70px;
    right: 16px;
    background: white;
    padding: 16px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1005;
    width: 200px;
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.font-size-menu.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.font-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.font-menu-header span {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.font-menu-header button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
}

.font-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 10px;
}

.font-controls button {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.font-controls button:hover {
    transform: scale(1.1);
    background: var(--primary-gradient);
    color: white;
}

.font-controls span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 3. Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    white-space: nowrap;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Prevent image overflow */
.mobile-news-card,
.article-detail-content,
.related-article-card {
    overflow: hidden;
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-news-card .card-image {
        height: 160px;
    }

    .article-hero-image {
        height: 180px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .mobile-news-card .card-image img,
    .article-hero-image img,
    .related-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== PREMIUM READING FEATURES ===== */

/* 1. Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 56px;
    /* Below header */
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1002;
}

.reading-progress-bar {
    height: 4px;
    background: var(--success-gradient);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.4);
}

/* 2. Font Size Control */
.mobile-app-header .font-size-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 16px;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-right: 8px;
}

.mobile-app-header .font-size-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.font-size-menu {
    position: fixed;
    top: 70px;
    right: 16px;
    background: white;
    padding: 16px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1005;
    width: 200px;
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.font-size-menu.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.font-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.font-menu-header span {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.font-menu-header button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
}

.font-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 10px;
}

.font-controls button {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.font-controls button:hover {
    transform: scale(1.1);
    background: var(--primary-gradient);
    color: white;
}

.font-controls span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 3. Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    white-space: nowrap;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    color: #25D366;
    font-size: 18px;
}

/* ===== SKELETON LOADING & BOOKMARKS ===== */

/* Bookmark Icon */
.bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #cbd5e0;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
}

.bookmark-btn:hover {
    transform: scale(1.1);
}

.bookmark-btn.active {
    color: #e53e3e;
    background: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.bookmark-btn.active i {
    font-weight: 900;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.skeleton-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.skeleton-image {
    width: 100%;
    height: 220px;
}

.skeleton-content {
    padding: 16px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 10px;
    border-radius: 4px;
    width: 90%;
}

.skeleton-title-short {
    height: 24px;
    margin-bottom: 16px;
    border-radius: 4px;
    width: 60%;
}

.skeleton-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.skeleton-meta-item {
    height: 16px;
    width: 80px;
    border-radius: 4px;
}

/* =====================================
   FIX ARTICLE VIEW WIDTH (FINAL FIX)
   ===================================== */

/* Main content must follow header width */
.mobile-app-content {
    max-width: 530px;        /* same as header */
    margin: 0 auto;          /* center */
    padding-left: 12px;
    padding-right: 12px;
    margin-top: 20px;    /* space below header */

}

/* Each article card */
.article-card,
.news-card,
.post-card {
    width: 100%;
    max-width: 100%;
}

/* Article image */
.article-card img,
.news-card img {
    width: 100%;
    height: auto;
    display: block;
}



