* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #c41e3a;
    --primary-dark: #a01830;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --text-muted: #999;
    --bg-light: #f8f9fa;
    --bg-lighter: #f0f2f5;
    --border-color: #e5e7eb;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #fff;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.navbar {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.logo-text .tagline {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
    position: relative;
    padding: 6px 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.search-input {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 220px;
    font-size: 14px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
    background: #fff;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.15);
    color: var(--primary);
}

.admin-link {
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.admin-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.breaking-ticker {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 12px 0;
    overflow: hidden;
}

.breaking-ticker .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.breaking-label {
    font-weight: 700;
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.breaking-label::before {
    content: '🔴';
    font-size: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

.ticker-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)), url('../assets/banner.jpg') center/cover no-repeat;
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(196, 30, 58, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h2 {
    font-size: 3.2rem;
    margin-bottom: 16px;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 32px;
    opacity: 0.95;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.trending-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--bg-lighter) 0%, #fff 100%);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    border-radius: 2px;
    margin-right: 12px;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.trending-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.trending-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.trending-card::before {
    content: attr(data-rank);
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow);
}

.trending-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-light);
}

.trending-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.trending-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    width: fit-content;
}

.trending-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-dark);
}

.trending-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item.views::before { content: '👁'; }
.meta-item.comments::before { content: '💬'; }
.meta-item.shares::before { content: '🔗'; }

.news-section {
    padding: 60px 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.news-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.news-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    width: fit-content;
}

.news-card h3 {
    font-size: 1.15rem;
    margin: 0 0 12px 0;
    color: var(--text-dark);
    line-height: 1.4;
    font-weight: 700;
}

.news-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.categories-section {
    padding: 60px 0;
    background: var(--bg-lighter);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.category-card {
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.category-card:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 28px;
}

.cta-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 60px 0;
    box-shadow: var(--shadow-lg);
}

.cta-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.cta-content {
    flex: 1;
}

.cta-content h3 {
    font-size: 1.4rem;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.cta-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.cta-button {
    padding: 12px 28px;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.submit-section {
    background: var(--bg-lighter);
    padding: 60px 0;
    min-height: calc(100vh - 200px);
}

.submit-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.submit-container h2 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 800;
}

.submit-subtitle {
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 15px;
}

.news-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-light);
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(196, 30, 58, 0.05);
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
}


body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .search-input {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .search-input:focus {
    background: #333;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.2);
}

body.dark-mode .nav-links a {
    color: #e0e0e0;
}

body.dark-mode .trending-card,
body.dark-mode .news-card,
body.dark-mode .submit-container,
body.dark-mode .category-card {
    background: #1e1e1e;
}

body.dark-mode .trending-title,
body.dark-mode .news-card h3 {
    color: #e0e0e0;
}

body.dark-mode .trending-excerpt,
body.dark-mode .news-card p {
    color: #b0b0b0;
}

body.dark-mode .card-meta,
body.dark-mode .trending-meta {
    border-color: #333;
    color: #999;
}

body.dark-mode .categories-section {
    background: #1a1a1a;
}

body.dark-mode .submit-section {
    background: #0a0a0a;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.3);
}

body.dark-mode .upload-area {
    background: #1a1a1a;
    border-color: #333;
}

body.dark-mode .upload-area:hover {
    background: rgba(196, 30, 58, 0.1);
}

body.dark-mode .section-title {
    color: #e0e0e0;
}

body.dark-mode .cta-banner {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .hero {
        padding: 50px 0;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .trending-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .submit-container {
        padding: 24px;
    }

    .cta-banner {
        flex-direction: column;
        text-align: center;
        margin: 40px 0;
    }

    .search-input {
        width: 160px;
    }

    .section-title {
        font-size: 22px;
    }

    .trending-card::before {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .navbar-content {
        padding: 8px 0;
    }

    .logo img {
        height: 36px;
        width: 36px;
    }

    .logo-text h1 {
        font-size: 18px;
    }

    .logo-text .tagline {
        display: none;
    }

    .nav-links {
        gap: 12px;
    }

    .search-input {
        display: none;
    }

    .admin-link {
        padding: 8px 14px;
        font-size: 12px;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 18px;
    }

    .section-title::before {
        height: 18px;
    }

    .news-grid {
        gap: 16px;
    }

    .trending-grid {
        gap: 16px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-banner {
        padding: 24px 16px;
        gap: 16px;
    }

    .cta-icon {
        font-size: 40px;
    }

    .cta-content h3 {
        font-size: 1.1rem;
    }

    .cta-content p {
        font-size: 0.9rem;
    }

    .submit-container {
        padding: 20px;
    }
}
