/* Modern Headlines Section */
.modern-headlines-section {
    padding: 60px 0 !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 10 !important;
    clear: both !important;
}

.modern-headlines-section::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') !important;
    pointer-events: none !important;
}

.modern-headlines-section .headlines-wrapper {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 40px !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Featured Story */
.modern-headlines-section .featured-story {
    position: relative !important;
    margin: 0 !important;
    align-self: flex-start !important;
}

.modern-headlines-section .featured-story-container {
    position: relative !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.4s ease !important;
    background: #fff !important;
    min-height: 500px !important;
    width: 100% !important;
    border: 2px solid #f0f0f0 !important; /* Debug border */
    display: block !important;
    visibility: visible !important;
}

.featured-story-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.2);
}

/* Featured Story Items - Dynamic Content */
.modern-headlines-section .featured-story-item {
    position: relative !important;
    height: 500px !important;
    display: flex !important;
    align-items: flex-end !important;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    width: 100% !important;
}

.modern-headlines-section .featured-story-item::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.8) 100%
    ) !important;
    z-index: 1 !important;
}

.modern-headlines-section .featured-content {
    position: relative !important;
    z-index: 2 !important;
    padding: 40px !important;
    color: white !important;
    width: 100% !important;
}

.modern-headlines-section .featured-category {
    display: inline-block !important;
    padding: 8px 16px !important;
    border-radius: 25px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 15px !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.modern-headlines-section .featured-title {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-bottom: 15px !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    color: white !important;
}

.modern-headlines-section .featured-meta {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    font-size: 14px !important;
    opacity: 0.9 !important;
    color: white !important;
}

.modern-headlines-section .featured-author {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: white !important;
}

.modern-headlines-section .featured-author img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.modern-headlines-section .featured-date {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: white !important;
}

/* Side Stories */
.modern-headlines-section .side-stories {
    background: white !important;
    border-radius: 20px !important;
    padding: 30px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
    position: sticky !important;
    top: 100px !important;
    display: block !important;
    visibility: visible !important;
    margin: 0 !important;
    align-self: flex-start !important;
    height: 500px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.modern-headlines-section .side-stories-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 25px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #f0f0f0 !important;
    flex-shrink: 0 !important;
}

.modern-headlines-section .side-stories-header h3 {
    font-size: 1.4rem !important;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.stories-navigation {
    display: flex;
    gap: 10px;
}

.side-stories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for Side Stories */
.side-stories-list::-webkit-scrollbar {
    width: 6px;
}

.side-stories-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.side-stories-list::-webkit-scrollbar-thumb {
    background: #027C02;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.side-stories-list::-webkit-scrollbar-thumb:hover {
    background: #025d02;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #027C02 0%, #027C02 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Side Story Items - Dynamic Content */
.modern-headlines-section .side-story-item {
    display: flex !important;
    gap: 15px !important;
    padding: 20px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    background: transparent !important;
}

.modern-headlines-section .side-story-item:hover {
    background: #f8f9fa !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.modern-headlines-section .side-story-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.modern-headlines-section .side-story-image {
    width: 80px !important;
    height: 80px !important;
    border-radius: 12px !important;
    background-size: cover !important;
    background-position: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.modern-headlines-section .side-story-content {
    flex: 1 !important;
}

.modern-headlines-section .side-story-category {
    display: inline-block !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    color: white !important;
}

.modern-headlines-section .side-story-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #2c3e50 !important;
    margin-bottom: 8px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.modern-headlines-section .side-story-meta {
    font-size: 12px !important;
    color: #7f8c8d !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Loading States */
.headlines-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Error States */
.headlines-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    flex-direction: column;
    gap: 20px;
}

.error-icon {
    font-size: 48px;
    color: #e74c3c;
}

.error-text {
    font-size: 16px;
    color: #7f8c8d;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .modern-headlines-section .headlines-wrapper {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .modern-headlines-section .side-stories {
        position: static !important;
        height: auto !important;
        max-height: 400px !important;
    }

    .modern-headlines-section .featured-title {
        font-size: 2rem !important;
    }

    .modern-headlines-section .featured-content {
        padding: 30px !important;
    }
}

@media (max-width: 768px) {
    .modern-headlines-section {
        padding: 40px 0 !important;
    }

    .modern-headlines-section .headlines-wrapper {
        gap: 20px !important;
    }

    .modern-headlines-section .featured-story-container {
        min-height: 350px !important;
    }

    .modern-headlines-section .featured-story-item {
        height: 350px !important;
    }

    .modern-headlines-section .featured-title {
        font-size: 1.8rem !important;
    }

    .modern-headlines-section .featured-content {
        padding: 25px !important;
    }

    .modern-headlines-section .side-stories {
        padding: 20px !important;
        height: auto !important;
        max-height: 350px !important;
    }

    .modern-headlines-section .side-story-item {
        gap: 12px !important;
        padding: 15px 0 !important;
    }

    .modern-headlines-section .side-story-image {
        width: 70px !important;
        height: 70px !important;
    }

    .modern-headlines-section .side-story-title {
        font-size: 13px !important;
    }
}

@media (max-width: 576px) {
    .modern-headlines-section {
        padding: 30px 0 !important;
    }

    .modern-headlines-section .container {
        padding: 0 15px !important;
    }

    .modern-headlines-section .headlines-wrapper {
        gap: 15px !important;
    }

    .modern-headlines-section .featured-story-container {
        min-height: 280px !important;
    }

    .modern-headlines-section .featured-story-item {
        height: 280px !important;
    }

    .modern-headlines-section .featured-title {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
    }

    .modern-headlines-section .featured-content {
        padding: 20px !important;
    }

    .modern-headlines-section .featured-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .modern-headlines-section .featured-category {
        font-size: 10px !important;
        padding: 6px 12px !important;
    }

    .modern-headlines-section .side-stories {
        padding: 15px !important;
        height: auto !important;
        max-height: 300px !important;
    }

    .modern-headlines-section .side-stories-header {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: flex-start !important;
        margin-bottom: 15px !important;
    }

    .modern-headlines-section .side-stories-header h3 {
        font-size: 1.2rem !important;
    }

    .stories-navigation {
        align-self: flex-end !important;
    }

    .nav-btn {
        width: 35px !important;
        height: 35px !important;
    }

    .modern-headlines-section .side-story-item {
        gap: 10px !important;
        padding: 12px 0 !important;
    }

    .modern-headlines-section .side-story-image {
        width: 60px !important;
        height: 60px !important;
    }

    .modern-headlines-section .side-story-title {
        font-size: 12px !important;
        -webkit-line-clamp: 3 !important;
    }

    .modern-headlines-section .side-story-category {
        font-size: 9px !important;
        padding: 3px 8px !important;
    }

    .modern-headlines-section .side-story-meta {
        font-size: 11px !important;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .modern-headlines-section {
        padding: 20px 0 !important;
    }

    .modern-headlines-section .container {
        padding: 0 10px !important;
    }

    .modern-headlines-section .featured-story-container {
        min-height: 250px !important;
    }

    .modern-headlines-section .featured-story-item {
        height: 250px !important;
    }

    .modern-headlines-section .featured-title {
        font-size: 1.1rem !important;
    }

    .modern-headlines-section .featured-content {
        padding: 15px !important;
    }

    .modern-headlines-section .side-stories {
        padding: 12px !important;
        max-height: 250px !important;
    }

    .modern-headlines-section .side-stories-header h3 {
        font-size: 1.1rem !important;
    }

    .nav-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }

    .modern-headlines-section .side-story-item {
        padding: 10px 0 !important;
    }

    .modern-headlines-section .side-story-image {
        width: 50px !important;
        height: 50px !important;
    }

    .modern-headlines-section .side-story-title {
        font-size: 11px !important;
    }
}

/* Animation Effects */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects */
.featured-story-item {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.side-story-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Focus States for Accessibility */
.nav-btn:focus,
.side-story-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading and Error States */
.headlines-loading,
.headlines-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #667eea;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text,
.error-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.7;
    color: #e74c3c;
}

/* Additional Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
