/* =================================
   Frontend Styles - Consolidated
   Moved from inline <style> blocks to improve:
   - Page load speed (reduced HTML size)
   - Browser caching (CSS cached separately)
   - SEO (better Core Web Vitals)
   ================================= */

/* ========== Hero Section ========== */
.hero-section {
    margin-bottom: 3rem;
}

.hero-article {
    border-radius: 1rem;
    overflow: hidden;
    min-height: 500px;
}

.hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero-article:hover .hero-image {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.3) 40%,
            rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.hero-content {
    z-index: 3;
}

.hero-title {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.hero-excerpt {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: white;
}

/* ========== Badge Styles ========== */
.badge-category {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
}

.badge-breaking {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    animation: pulse 2s infinite;
}

.badge-featured {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* ========== Top Stories ========== */
.top-stories-card {
    border-radius: 1rem;
    overflow: hidden;
}

.story-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.story-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.story-featured {
    background: linear-gradient(135deg, #667eea15, #764ba215);
}

.story-image-wrapper {
    border-radius: 0.5rem;
    overflow: hidden;
}

.story-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.story-item:hover .story-image {
    transform: scale(1.1);
}

.story-rank {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.story-link:hover {
    color: #667eea !important;
}

/* ========== Latest News Cards ========== */
.latest-news-card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.latest-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.latest-news-card .card-img-top {
    transition: transform 0.5s ease;
}

.latest-news-card:hover .card-img-top {
    transform: scale(1.1);
}

/* ========== Category Page ========== */
.news-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.news-item.filtered-out {
    display: none !important;
}

.category-news-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.category-header {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ========== Search Page ========== */
.search-news-card {
    transition: all 0.3s ease;
}

.search-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

.search-news-card .card-title a {
    transition: color 0.3s ease;
}

.search-news-card:hover .card-title a {
    color: #667eea !important;
}

/* ========== General Card Effects ========== */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
}

/* ========== Section Headers ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* ========== Breaking News Ticker ========== */
/* Ticker animation is defined in app.blade.php for better control */

/* ========== Weather Card ========== */
.weather-card {
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.weather-card .card-header {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
}

.weather-card .card-header h5 {
    color: white !important;
    font-weight: 600;
}

.weather-card .card-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.weather-icon {
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    color: #ff9800;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(5deg);
    }

    50% {
        transform: translateY(-15px) rotate(0deg);
    }

    75% {
        transform: translateY(-10px) rotate(-5deg);
    }
}

.weather-temp {
    font-size: 2.5rem;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease;
}

.weather-desc {
    font-size: 1.1rem;
    color: #495057 !important;
    font-weight: 500;
    animation: fadeInUp 0.8s ease;
}

.weather-location {
    color: #0d6efd !important;
    font-size: 0.95rem;
    animation: fadeInUp 1s ease;
}

.weather-stats {
    animation: fadeInUp 1.2s ease;
}

.weather-stats strong {
    font-size: 1.1rem;
    color: #212529 !important;
}

.weather-stats small {
    font-size: 0.85rem;
    color: #6c757d !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.weather-loading {
    padding: 40px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.weather-error {
    padding: 30px 0;
}

.weather-error p {
    color: #6c757d;
    font-weight: 500;
}

#toggle-weather-location {
    opacity: 0.8;
    transition: all 0.3s ease;
}

#toggle-weather-location:hover {
    opacity: 1;
    transform: scale(1.1) rotate(180deg);
}

/* ========== Social Card ========== */
.social-card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.social-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.social-card .card-header {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%) !important;
}

.social-card .card-header h5 {
    color: white !important;
    font-weight: 600;
}

.social-link {
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    color: #212529 !important;
}

.social-link:hover {
    transform: translateX(5px);
}

.social-link.facebook:hover {
    background: #1877f2 !important;
    color: white !important;
}

.social-link.twitter:hover {
    background: #1da1f2 !important;
    color: white !important;
}

.social-link.youtube:hover {
    background: #ff0000 !important;
    color: white !important;
}

.social-link.linkedin:hover {
    background: #0077b5 !important;
    color: white !important;
}

.social-link.whatsapp:hover {
    background: #25d366 !important;
    color: white !important;
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    color: white !important;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .hero-article {
        min-height: 350px;
    }
}

@media (max-width: 576px) {
    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .section-header .btn {
        margin-top: 1rem;
    }
}

/* ========== Performance Optimization ========== */
/* will-change hint for animations */
.hero-image,
.story-image,
.latest-news-card .card-img-top {
    will-change: transform;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}