/* style.css - Giao diện trang tin tức RSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: #f1ca2d;
    padding: 30px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-bottom: 2px solid #f1ca2d;
}

.logo {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(to right, #f1ca2d, #deb829);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.tagline {
    font-size: 1.1em;
    opacity: 0.9;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Navigation */
.nav {
    background: #f1ca2d;
    border-bottom: 2px solid #000000;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.nav .container {
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    width: 100%;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: #000000;
    transition: all 0.3s ease;
    transform-origin: left;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.nav-list li {
    position: relative;
}

.nav-item {
    display: flex;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    margin: 4px 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    text-decoration: none;
    color: #f1ca2d;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-grow: 1;
    font-size: 1.05em;
    letter-spacing: 0.3px;
}

.nav-link:hover {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: #f1ca2d;
}

.nav-link.active {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: #f1ca2d;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.dropdown-toggle {
    padding: 0 20px;
    background: #1a1a1a;
    border: none;
    cursor: pointer;
    color: #f1ca2d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 50px;
    position: relative;
    overflow: hidden;
    border-radius: 0 12px 12px 0;
}

.dropdown-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1ca2d 0%, #deb829 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dropdown-toggle:hover {
    color: #000000;
}

.dropdown-toggle:hover::before {
    opacity: 1;
}

.dropdown-icon {
    font-size: 1em;
    transition: all 0.3s ease;
    opacity: 1;
    position: relative;
    color: #f1ca2d;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.dropdown.open .dropdown-toggle {
    background: #000000;
    color: #f1ca2d;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.dropdown.open .dropdown-icon {
    transform: rotate(180deg);
    color: #f1ca2d;
}

/* Add subtle animation for active state */
.dropdown.open .dropdown-toggle::before {
    opacity: 0;
    background: linear-gradient(135deg, #f1ca2d 0%, #deb829 100%);
}

/* Hover effect for entire nav item */
.nav-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 12px;
    list-style: none;
    padding: 8px;
    z-index: 1001;
    border: 1px solid rgba(237, 242, 247, 0.8);
    pointer-events: auto;
    animation: dropdownFade 0.25s ease;
    backdrop-filter: blur(10px);
    transform-origin: top center;
}

/* SCMP Dropdown specific styles */
.nav-list > li:first-child .dropdown-menu {
    display: none;
    min-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px;
    background: #1a1a1a;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Ẩn scrollbar cho Chrome, Safari và Opera */
.nav-list > li:first-child .dropdown-menu::-webkit-scrollbar {
    display: none;
}

/* Mega Menu Styles */
.mega-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mega-menu-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.mega-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: #f1ca2d;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mega-menu-header:hover {
    background: rgba(241, 202, 45, 0.1);
    border-radius: 8px;
}

.mega-menu-toggle {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.mega-menu-item.active .mega-menu-toggle {
    transform: rotate(90deg);
}

.mega-menu-content {
    display: none;
    padding: 5px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
}

.mega-menu-item.active .mega-menu-content {
    display: block;
}

.mega-menu-content a {
    padding: 8px 20px;
    color: #f1ca2d;
    opacity: 0.8;
    transition: all 0.2s ease;
    font-size: 0.95em;
}

.mega-menu-content a:hover {
    opacity: 1;
    background: rgba(241, 202, 45, 0.1);
    transform: none;
    padding-left: 25px;
}

.dropdown-category-group {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
}

.dropdown-category {
    color: #f1ca2d;
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(241, 202, 45, 0.3);
}

.dropdown-category-group a {
    padding: 6px 10px;
    margin: 2px 0;
    font-size: 0.95em;
    border-radius: 4px;
}

.dropdown-category-group a:hover {
    background: rgba(241, 202, 45, 0.1);
    transform: none;
    padding-left: 15px;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid rgba(237, 242, 247, 0.8);
    border-top: 1px solid rgba(237, 242, 247, 0.8);
}

.dropdown-menu li {
    margin: 4px 0;
}

.dropdown-menu {
    background: #1a1a1a;
    border: 1px solid #333;
}

.dropdown-menu::before {
    background: #1a1a1a;
    border-left: 1px solid #333;
    border-top: 1px solid #333;
}

.dropdown-menu a {
    display: block;
    padding: 12px 18px;
    color: #f1ca2d;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 0.95em;
    font-weight: 500;
    position: relative;
    background: transparent;
}

.dropdown-menu a:hover {
    background: linear-gradient(to right, rgba(241, 202, 45, 0.1) 0%, transparent 100%);
    color: #f1ca2d;
    transform: translateX(5px);
    padding-left: 24px;
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background: #f1ca2d;
    transform: translateY(-50%);
    transition: width 0.25s ease;
    opacity: 0;
}

.dropdown-menu a:hover::before {
    width: 12px;
    opacity: 1;
}

/* Remove hover behavior as it's now handled by JavaScript */
.dropdown-menu {
    display: none;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    padding: 10px 20px;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background: #f5f7fa;
    color: #667eea;
}

    .refresh-btn {
    padding: 14px 24px;
    background: #000000;
    color: #f1ca2d;
    border: 2px solid #000000;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    margin: 4px 8px;
}

.refresh-btn:hover {
    background: transparent;
    color: #000000;
    transform: translateY(-1px);
}

.mobile-refresh {
    display: none;
}

.refresh-container {
    margin-left: auto;
}

/* Style cho desktop */
.desktop-refresh {
    display: inline-flex;
    margin: 4px 8px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
}/* Main Content */
.main-content {
    padding: 30px 20px;
    min-height: calc(100vh - 400px);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.content-header h2 {
    font-size: 2em;
    color: #2d3748;
}

.news-count {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9em;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f7fa;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85em;
}

.news-source {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.news-date {
    color: #718096;
}

.news-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: #667eea;
}

.news-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 8px 12px;
    background: #f7fafc;
    border-left: 3px solid #667eea;
    border-radius: 4px;
}

.link-icon {
    font-size: 1em;
}

.source-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    word-break: break-all;
    transition: color 0.3s ease;
}

.source-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.news-author {
    color: #718096;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.news-description {
    color: #4a5568;
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.6;
}

.news-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.action-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.copy-content-btn {
    border-color: #48bb78;
    color: #48bb78;
}

.copy-content-btn:hover:not(:disabled) {
    background: #48bb78;
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.read-more {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.read-more:hover {
    color: #764ba2;
    transform: translateX(5px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 16px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* No News */
.no-news {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.no-news p {
    font-size: 1.2em;
    color: #718096;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: #f1ca2d;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
    border-top: 2px solid #f1ca2d;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.footer p {
    margin: 8px 0;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.footer p:first-child {
    font-weight: 600;
    color: #f1ca2d;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

.toast.success {
    background-color: #48bb78;
}

.toast.error {
    background-color: #f56565;
}

@keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }
    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }
    to {
        bottom: 0;
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 1.8em;
    }
    
    .tagline {
        font-size: 0.95em;
    }

    /* SCMP Dropdown responsive */
    .nav-list > li:first-child .dropdown-menu {
        min-width: 100%;
        columns: 2;
        padding: 15px;
    }

    .nav-header {
        display: flex;
    }

    .hamburger-menu {
        display: flex;
    }

    .nav-content {
        display: none;
        width: 100%;
    }

    .nav-content.open {
        display: block;
        animation: slideDown 0.3s ease;
    }

    .nav .container {
        gap: 0;
    }
    
    .nav-list {
        width: 100%;
        flex-direction: column;
        padding: 8px 0;
        background: white;
    }
    
    .nav-item {
        margin: 2px 12px;
        border-radius: 8px;
        background: rgba(26, 26, 26, 0.05);
    }

    .nav-link {
        padding: 16px 20px;
        font-size: 1em;
        border-radius: 8px 0 0 8px;
        color: #1a1a1a;
    }

    .dropdown-menu {
        background: #1a1a1a;
        border: none;
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }

    .nav-content.open .nav-item {
        animation: slideIn 0.3s ease forwards;
        opacity: 0;
        transform: translateX(-10px);
    }

    @keyframes slideIn {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Add delay for each menu item */
    .nav-content.open .nav-item:nth-child(1) { animation-delay: 0.1s; }
    .nav-content.open .nav-item:nth-child(2) { animation-delay: 0.15s; }
    .nav-content.open .nav-item:nth-child(3) { animation-delay: 0.2s; }
    .nav-content.open .nav-item:nth-child(4) { animation-delay: 0.25s; }
    .nav-content.open .nav-item:nth-child(5) { animation-delay: 0.3s; }
    
    .desktop-refresh {
        display: none;
    }

    .mobile-refresh {
        display: inline-flex;
        min-width: 120px;
        margin-left: 10px;
        padding: 8px 15px;
        align-items: center;
        justify-content: center;
        background: #000000;
        color: #f1ca2d;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .content-header h2 {
        font-size: 1.5em;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
        background: #1a1a1a;
        border: none;
        border-top: 1px solid #333;
    }

    .dropdown-menu li {
        margin: 0;
    }

    .dropdown-menu a {
        padding: 12px 25px;
        border-radius: 0;
        color: #f1ca2d;
        background: transparent;
    }

    .dropdown-menu a:hover {
        background: rgba(241, 202, 45, 0.1);
        color: #f1ca2d;
    }

    .dropdown.open .dropdown-menu {
        display: block;
        animation: slideDown 0.2s ease;
    }

    /* Hamburger menu animation */
    .hamburger-menu.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg);
    }

    .hamburger-menu.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    /* SCMP Dropdown mobile */
    .nav-list > li:first-child .dropdown-menu {
        columns: 1;
        padding: 10px;
    }
    
    .header {
        padding: 20px 0;
    }
    
    .logo {
        font-size: 1.5em;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-list li {
        width: 100%;
    }
    
    .nav-list a {
        width: 100%;
        text-align: center;
    }
    
    .news-card {
        margin-bottom: 20px;
    }
}


