/* ============================================================
   CUSTOM STYLES FOR NEWS WEBSITE
   ============================================================ */

/* Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    border-bottom: 3px solid var(--primary-color);
}

.navbar-brand {
    color: var(--primary-color) !important;
}

.navbar-brand .category-logo {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 767px) {
    .navbar-brand .category-logo {
        max-height: 40px;
    }
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Top Header Icon Layout - 2x2 on Mobile */
.top-header .d-flex.gap-2 {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.5rem !important;
}

@media (max-width: 767px) {
    .top-header .d-flex.gap-2 {
        max-width: 140px;
    }
    
    .top-header .btn {
        flex: 0 0 calc(50% - 0.25rem);
        min-width: 60px;
        padding: 0.5rem 0.25rem !important;
    }
    
    .top-header .btn i {
        font-size: 1.25rem !important;
    }
    
    .top-header .btn small {
        font-size: 0.65rem;
        margin-top: 2px;
    }
}

/* Category Horizontal Scroll */
.category-scroll-wrapper {
    position: relative;
}

.category-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-behavior: smooth;
}

.category-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-scroll .btn {
    white-space: nowrap;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background-color: white;
    border: 1px solid #dee2e6;
}

.category-scroll .btn:hover {
    background-color: var(--primary-color);
    color: white !important;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-scroll .btn:active {
    transform: translateY(0);
}

@media (max-width: 767px) {
    .category-scroll .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem !important;
    }
    
    .category-scroll img {
        height: 16px !important;
        width: 16px !important;
    }
}

/* Subcategory Navigation on Category Pages */
.subcategory-nav {
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
}

.subcategory-nav .d-flex {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.subcategory-nav .d-flex::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.subcategory-nav .btn {
    border-radius: 20px;
    transition: all 0.3s;
}

.subcategory-nav .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* Breaking News Ticker */
.breaking-news {
    overflow: hidden;
}

.breaking-news-slider {
    display: flex;
    animation: scroll-left 30s linear infinite;
    white-space: nowrap;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Pulse Animation for Live Badge */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Section Headers */
.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.news-card .card-img-top {
    height: 180px;
}

/* Featured Cards */
.featured-main .card-img {
    height: 500px;
    object-fit: cover;
}

.featured-side .card {
    height: 120px;
}

/* Stories Section */
.stories-container {
    scrollbar-width: thin;
}

.stories-container::-webkit-scrollbar {
    height: 8px;
}

.stories-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.story-item {
    text-align: center;
    min-width: 80px;
}

.story-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    padding: 3px;
}

.story-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Video Overlay */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.play-button {
    font-size: 4rem;
    color: white;
    text-decoration: none;
}

/* Reel Overlay */
.reel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
}

.reel-card:hover .reel-overlay {
    opacity: 1;
}

/* Live News Card */
.live-news-card {
    border-left: 4px solid var(--danger-color);
}

/* Gallery Card */
.gallery-card {
    border-top: 3px solid var(--warning-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.back-to-top.show {
    display: flex;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.footer a:hover {
    color: var(--primary-color) !important;
}

/* Article Page */
.article-header {
    margin-bottom: 30px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

.article-content h2, 
.article-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Article Actions */
.article-actions {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.article-actions .btn {
    border-radius: 20px;
}

/* Comments Section */
.comment-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

/* Sidebar Widgets */
.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.sidebar-widget h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.widget-article-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.widget-article-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-article-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* Category Page */
.category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    /* padding: 40px 0; */
    margin-bottom: 30px;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 30px;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Admin Panel Styles */
.admin-sidebar {
    background: #2c3e50;
    min-height: 100vh;
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: #ecf0f1;
    padding: 12px 20px;
    border-left: 3px solid transparent;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: #34495e;
    border-left-color: var(--primary-color);
    color: white;
}

.admin-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 30px;
    margin-bottom: 30px;
}

/* Data Tables */
.table-responsive {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: var(--primary-color);
    color: white;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Election Dashboard */
.election-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.party-color-box {
    width: 20px;
    height: 20px;
    display: inline-block;
    border-radius: 3px;
    margin-right: 8px;
}

/* Cricket Score Card */
.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.team-score {
    font-size: 3rem;
    font-weight: 700;
}

/* Market Ticker */
.market-ticker {
    background: #000;
    color: #0f0;
    padding: 15px;
    font-family: monospace;
    overflow: hidden;
}

.ticker-item {
    display: inline-block;
    margin-right: 50px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .featured-main .card-img {
        height: 300px;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    border-radius: 8px;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 5px 10px;
}

/* Social Share Buttons */
.social-share {
    display: flex;
    gap: 10px;
}

.social-share a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
}

.social-share .facebook { background: #3b5998; }
.social-share .twitter { background: #1da1f2; }
.social-share .whatsapp { background: #25d366; }
.social-share .telegram { background: #0088cc; }

/* Timeline Styles for Live Updates */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #dc3545, #007bff);
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    padding-bottom: 30px;
    animation: fadeInUp 0.5s ease-out;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 20px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #dc3545;
    z-index: 2;
    animation: pulse 2s infinite;
}

.timeline-item:nth-child(even) .timeline-marker {
    border-color: #007bff;
}

.timeline-item:not(:first-child) .timeline-marker {
    border-color: #6c757d;
    animation: none;
}

.timeline-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(5px);
}

.timeline-time {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-item:not(:first-child) .timeline-time {
    background: #6c757d;
}

.timeline-text {
    color: #333;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.timeline-badge {
    position: absolute;
    left: 12px;
    top: 0;
    background: #dc3545;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    animation: blink 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.5;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-marker {
        left: 12px;
        width: 18px;
        height: 18px;
    }
    
    .timeline-badge {
        left: 4px;
    }
}

/* Print Styles */
@media print {
    .header, .footer, .sidebar, .breaking-news, .article-actions {
        display: none;
    }
}

/* Reel Player Styles */
.reel-player-section .bg-gradient-dark {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.reel-player-section .ratio-9x16 {
    --bs-aspect-ratio: 177.78%;
}

.reel-player-section video {
    background: #000;
    object-fit: contain;
}

.reel-player-section .card {
    border-radius: 16px;
}

.reel-player-section .btn-lg {
    font-size: 1.1rem;
    padding: 12px 24px;
}
