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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    line-height: 1.6;
}

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

/* Header Styles */
.main-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

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

.search-box {
    flex: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    padding: 0.625rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
}

.hero-article {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s;
}

.hero-article:hover {
    transform: translateY(-4px);
}

.hero-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero-image {
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    color: white;
    z-index: 1;
}

.hero-category {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-summary {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.category-header,
.search-header {
    padding: 2rem 0;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.category-title,
.search-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-count,
.search-count,
.search-query {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.article-card {
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}

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

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
}

.author {
    font-weight: 500;
}

/* Article Detail Page */
.article-main {
    padding: 3rem 0;
}

.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
}

.article-category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-detail .article-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-primary);
    -webkit-line-clamp: unset;
    display: block;
}

.article-detail .article-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.article-image-large {
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.article-summary-large {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.article-content {
    margin-bottom: 2rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Disable text selection for article cards and summaries */
.article-card .article-content,
.article-card .article-summary,
.article-card .article-title,
.article-summary-large,
.article-detail .article-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tag {
    padding: 0.375rem 0.875rem;
    background: var(--bg-light);
    color: var(--text-secondary);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Related Section */
.related-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

/* Featured/Latest Sections */
.featured-section,
.latest-section,
.articles-section {
    padding: 3rem 0;
}

/* No Articles State */
.no-articles {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-articles p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Footer */
.main-footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: var(--text-light);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav {
        justify-content: center;
    }

    .search-box {
        max-width: 100%;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-content {
        padding: 2rem 1.5rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-detail .article-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .category-title,
    .search-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-image {
        height: 300px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .article-image-large {
        height: 300px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeIn 0.5s ease-out;
}

/* Layout enhancements */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.hero-side {
    display: grid;
    gap: 1rem;
}

.side-card {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    box-shadow: var(--shadow-sm);
}

.side-image {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
}

.side-content .article-title {
    margin-bottom: 0.4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Breaking ticker */
.breaking-bar {
    background: linear-gradient(90deg, #dc2626, #f97316);
    color: white;
    padding: 0.35rem 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.breaking-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breaking-label {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticker {
    overflow: hidden;
    position: relative;
    flex: 1;
}

.ticker-track {
    display: flex;
    gap: 2rem;
    animation: tickerMove 18s linear infinite;
}

.ticker-item {
    color: white;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}

@keyframes tickerMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Flash messages */
.flash-container {
    margin-top: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.flash-success { background: #ecfdf3; color: #166534; }
.flash-error { background: #fef2f2; color: #b91c1c; }
.flash-warning { background: #fffbeb; color: #92400e; }

/* Auth */
.auth-section {
    padding: 4rem 0;
}

.auth-container {
    max-width: 480px;
}

.auth-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.auth-card h2 {
    margin-bottom: 1.5rem;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-grid input,
.form-grid textarea,
.form-grid select {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
}

.form-grid textarea {
    resize: vertical;
}

.full-width {
    width: 100%;
    margin-top: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.checkbox-row {
    display: flex;
    gap: 1.5rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.admin-hero {
    padding: 2.5rem 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.text-muted {
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.admin-panel {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    display: grid;
    gap: 0.5rem;
}

.table-head, .table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.table-row {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

.link.danger {
    color: #dc2626;
}

.inline-form {
    display: inline;
}

.logout-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pill-primary { background: rgba(37, 99, 235, 0.15); color: #1d4ed8; }
.pill-accent { background: rgba(236, 72, 153, 0.15); color: #db2777; }

.form-inline {
    display: flex;
    gap: 0.5rem;
}

.form-inline input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.admin-form {
    gap: 1rem;
}

/* Article share */
.article-share {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.share-btn.twitter { color: #1d9bf0; }
.share-btn.facebook { color: #0d6efd; }
.share-btn.copy { color: var(--text-primary); }

.article-video {
    margin: 1.5rem 0;
}

.article-video iframe {
    width: 100%;
    min-height: 360px;
    border-radius: 12px;
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}