/* ==========================================
   News Portal - Main Stylesheet
   ========================================== */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --success-color: #198754;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.7;
}

a {
    transition: all 0.3s ease;
}

/* Top Bar */
.top-bar {
    font-size: 0.875rem;
}

/* Navbar */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar .nav-link {
    padding: 0.75rem 1rem !important;
    font-weight: 500;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* News Cards */
.news-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.news-card .card-img-top {
    transition: transform 0.3s ease;
}

.news-card:hover .card-img-top {
    transform: scale(1.05);
}

.news-card .card-title a:hover {
    color: var(--primary-color) !important;
}

/* Featured Carousel */
#featuredCarousel .carousel-caption {
    bottom: 20px;
    right: 20px;
    left: 20px;
    text-align: right;
}

#featuredCarousel .carousel-item img {
    transition: transform 0.5s ease;
}

/* Sidebar */
.sidebar .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.sidebar .card-header {
    font-weight: 600;
}

.sidebar .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1rem;
}

.sidebar .list-group-item:first-child {
    border-top: none;
}

.sidebar .list-group-item:hover {
    background-color: var(--light-color);
}

/* News Content */
.news-content {
    font-size: 1.1rem;
    line-height: 2;
}

.news-content p {
    margin-bottom: 1.5rem;
}

/* Comments */
.comment {
    padding: 1rem 0;
}

.comment:last-child {
    border-bottom: none !important;
}

/* Live Stream */
.live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* Footer */
footer {
    margin-top: auto;
}

footer h5 {
    margin-bottom: 1.5rem;
}

footer .social-links a {
    font-size: 1.25rem;
    transition: opacity 0.3s ease;
}

footer .social-links a:hover {
    opacity: 0.7;
}

/* Search Results */
.search-highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Pagination */
.pagination .page-link {
    border-radius: 5px;
    margin: 0 3px;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Buttons */
.btn {
    border-radius: 5px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
}

/* Cards */
.card {
    border-radius: 10px;
    overflow: hidden;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
}

/* Tables */
.table thead th {
    font-weight: 600;
    border-bottom-width: 1px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .top-bar .row > div {
        text-align: center !important;
    }
    
    #featuredCarousel .carousel-item img {
        height: 250px !important;
    }
    
    .news-content {
        font-size: 1rem;
    }
    
    footer .row > div {
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .navbar, .top-bar, footer, .sidebar, .btn, form {
        display: none !important;
    }
    
    .col-lg-8 {
        width: 100% !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Hover Effect */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* 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; }
}

/* Hero News Section */
.hero-news-section {
    padding: 20px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.hero-main-card {
    height: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-main-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.hero-main-img {
    height: 420px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-main-card:hover .hero-main-img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-meta {
    font-size: 0.9rem;
}

.hero-small-card {
    height: 206px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-small-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.hero-small-img {
    height: 206px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-small-card:hover .hero-small-img {
    transform: scale(1.08);
}

.hero-small-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.hero-small-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 991px) {
    .hero-main-card, .hero-main-img {
        height: 300px;
    }
    .hero-small-card, .hero-small-img {
        height: 145px;
    }
    .hero-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 575px) {
    .hero-main-card, .hero-main-img {
        height: 250px;
    }
    .hero-small-card, .hero-small-img {
        height: 120px;
    }
    .hero-overlay {
        padding: 15px;
    }
    .hero-title {
        font-size: 1rem;
    }
    .hero-small-title {
        font-size: 0.75rem;
    }
}

/* Dedications Marquee */
.dedications-marquee {
    overflow: hidden;
    position: relative;
}

.dedications-track {
    display: flex;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.dedications-track:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.dedication-item {
    flex-shrink: 0;
    padding: 0 10px;
}

.dedication-card {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border-radius: 15px;
    padding: 15px 20px;
    min-width: 280px;
    max-width: 320px;
    border: 2px solid #ffcccc;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.1);
}

.dedication-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.dedication-header .sender {
    color: #dc3545;
    font-weight: bold;
}

.dedication-header .recipient {
    color: #198754;
    font-weight: bold;
}

.dedication-message {
    margin: 0;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.5;
}

/* Fixed Bottom Dedications Ticker */
.dedications-ticker-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    z-index: 1050;
    display: flex;
    align-items: center;
    height: 45px;
    box-shadow: 0 -3px 15px rgba(0,0,0,0.2);
}

.dedications-ticker-header {
    background: rgba(0,0,0,0.2);
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    white-space: nowrap;
}

.dedications-ticker-content {
    flex: 1;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
}

.dedications-ticker-track {
    display: flex;
    animation: tickerScroll 40s linear infinite;
    white-space: nowrap;
}

.dedications-ticker-track:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticker-sender {
    color: #ffd700;
    font-weight: bold;
}

.ticker-recipient {
    color: #90EE90;
    font-weight: bold;
}

.ticker-message {
    color: #fff;
}

.dedications-ticker-btn {
    background: rgba(0,0,0,0.2);
    color: white;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background 0.3s;
}

.dedications-ticker-btn:hover {
    background: rgba(0,0,0,0.4);
    color: white;
}

/* Add padding to body to prevent content from being hidden behind ticker */
body {
    padding-bottom: 50px;
}

/* Floating Heart Button (Mobile) */
.floating-heart-btn {
    position: fixed;
    left: 15px;
    bottom: 70px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #ff6b6b 0%, #dc3545 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    z-index: 1040;
    animation: floatingHeart 2s ease-in-out infinite;
    transition: transform 0.3s, box-shadow 0.3s;
}

.floating-heart-btn:hover {
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}

@keyframes floatingHeart {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Live Stream Pulse Animation */
.pulse-animation {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.live-badge {
    z-index: 10;
}

/* Video Cards */
.video-card {
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.video-thumb {
    height: 140px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumb {
    transform: scale(1.05);
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, color 0.3s ease;
    pointer-events: none;
}

.video-card:hover .video-play-overlay {
    transform: translate(-50%, -50%) scale(1.2);
    color: #dc3545;
}

.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

.video-title {
    font-size: 0.85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* News Content - Editor HTML Styles */
.news-content {
    font-size: 1.1rem;
    line-height: 1.9;
}

.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.news-content h1, .news-content h2, .news-content h3 {
    margin: 1.5rem 0 1rem;
    font-weight: 700;
}

.news-content p {
    margin: 1rem 0;
}

.news-content ul, .news-content ol {
    margin: 1rem 0;
    padding-right: 2rem;
}

.news-content li {
    margin: 0.5rem 0;
}

.news-content blockquote {
    border-right: 4px solid var(--primary-color);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(13, 110, 253, 0.05);
    border-radius: 6px;
}

.news-content a {
    color: var(--primary-color);
}

.news-content iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}
