/**
 * NewsPortal - Custom Styles
 * Additional styles beyond Tailwind CSS
 */

/* Root Variables */
:root {
    --primary-color: #e11d48;
    --primary-dark: #be123c;
    --secondary-color: #0c0a09;
    --text-color: #1c1917;
    --text-muted: #78716c;
    --bg-light: #fafaf9;
    --border-color: #e7e5e4;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans Bengali', 'Noto Sans', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Remove underline from all links */
a {
    text-decoration: none;
}

a.no-underline {
    text-decoration: none !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

/* Breaking News Ticker */
.breaking-ticker {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    overflow: hidden;
    white-space: nowrap;
}

.breaking-ticker-content {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.breaking-ticker:hover .breaking-ticker-content {
    animation-play-state: paused;
}

/* News Cards */
.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.news-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.news-card-image {
    position: relative;
    overflow: hidden;
}

.news-card-image img {
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

/* Category Labels */
.category-label {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    color: white;
}

.category-label.politics { background: #dc2626; }
.category-label.sports { background: #16a34a; }
.category-label.entertainment { background: #9333ea; }
.category-label.business { background: #2563eb; }
.category-label.world { background: #0891b2; }
.category-label.tech { background: #7c3aed; }

/* Live Badge */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    animation: pulse-live 2s infinite;
}

.live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Trending Section */
.trending-list {
    counter-reset: trending;
}

.trending-item {
    counter-increment: trending;
    position: relative;
    padding-left: 40px;
}

.trending-item::before {
    content: counter(trending);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* Visual Stories */
.visual-story {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.visual-story::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
}

.visual-story-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 1;
    color: white;
}

/* Video Play Button */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(229, 62, 62, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.video-play-btn:hover {
    background: #e53e3e;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Navbar Sticky */
.navbar-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #1f2937;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f3f4f6;
    color: #e53e3e;
}

/* Poll Widget */
.poll-option {
    position: relative;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.poll-option:hover {
    background: #fef2f2;
}

.poll-option.selected {
    border: 2px solid #e53e3e;
}

.poll-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(229, 62, 62, 0.1);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* Share Buttons */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.linkedin { background: #0077b5; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumb a:hover {
    color: #e53e3e;
}

.breadcrumb-separator {
    color: #d1d5db;
}

/* Article Content Styles */
.article-content {
    font-size: 18px;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2 {
    font-size: 24px;
    margin: 2em 0 1em;
}

.article-content h3 {
    font-size: 20px;
    margin: 1.5em 0 0.75em;
}

.article-content blockquote {
    border-left: 4px solid #e53e3e;
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    color: #4b5563;
}

.article-content ul, .article-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.article-content li {
    margin-bottom: 0.5em;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}

.article-content a {
    color: #e53e3e;
    text-decoration: underline;
}

/* Admin Panel Styles */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #e53e3e;
}

.admin-sidebar-link i {
    width: 20px;
    text-align: center;
}

/* Video Embed Aspect Ratio (global) */
.aspect-video {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.aspect-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aspect-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Mobile Menu */
@media (max-width: 768px) {
    /* Smooth sidebar scrolling */
    #mobileMenu {
        -webkit-overflow-scrolling: touch;
    }
    
    #mobileMenu nav a:active {
        background-color: #fef2f2;
    }
    
    /* Better touch targets for mobile */
    .nav-link, 
    .breadcrumb a,
    .pagination a,
    .share-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    /* Fix footer app download buttons stacking */
    .footer-app-links {
        flex-direction: column;
    }
}

/* No scrollbar utility */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Touch-friendly spacing for mobile */
@media (max-width: 640px) {
    /* Full-width container on mobile — remove side gaps */
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }

    /* Keep small padding inside header and footer nav */
    header .container,
    footer .container,
    nav .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Remove all rounded corners on mobile for full-bleed look */
    .rounded-xl,
    .rounded-lg,
    .rounded-md,
    .rounded {
        border-radius: 0 !important;
    }

    article,
    .bg-white,
    .shadow-lg,
    .shadow-md,
    .admin-card,
    .widget,
    .swiper,
    .aspect-video {
        border-radius: 0 !important;
    }

    /* Larger tap targets */
    .category-label {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    /* Article content images full-bleed on mobile */
    .article-content img {
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
        border-radius: 0;
    }
    
    /* Fix table overflow in article content */
    .article-content table,
    .news-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Poll options spacing */
    .poll-option {
        padding: 14px 16px;
    }
}

/* Print Styles */
@media print {
    header, footer, .share-buttons, .related-news, .comments, .ads {
        display: none !important;
    }
    
    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        --bg-color: #1a1a2e;
        --text-color: #e5e7eb;
        --card-bg: #16213e;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
