:root {
    --primary: #E63946;
    --secondary: #1D3557;
    --accent: #00D4FF;
    --bg: #0A0A0F;
    --surface: #111827;
    --surface2: #1F2937;
    --text: #F9FAFB;
    --text-muted: #9CA3AF;
    --border: #374151;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark {
    --bg: #0A0A0F;
    --surface: #111827;
    --surface2: #1F2937;
    --text: #F9FAFB;
    --text-muted: #9CA3AF;
    --border: #374151;
}

body:not(.dark) {
    --bg: #F9FAFB;
    --surface: #FFFFFF;
    --surface2: #F3F4F6;
    --text: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
}

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

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slideUp {
    animation: slideUp 0.5s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg,
            var(--surface) 0%,
            var(--surface2) 50%,
            var(--surface) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

[data-animation="fade-up"] {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

[data-animation="fade-up"]:nth-child(1) {
    animation-delay: 0.1s;
}

[data-animation="fade-up"]:nth-child(2) {
    animation-delay: 0.2s;
}

[data-animation="fade-up"]:nth-child(3) {
    animation-delay: 0.3s;
}

[data-animation="fade-up"]:nth-child(4) {
    animation-delay: 0.4s;
}

[data-animation="fade-up"]:nth-child(5) {
    animation-delay: 0.5s;
}

[data-animation="fade-up"]:nth-child(6) {
    animation-delay: 0.6s;
}

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

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

.breaking-card {
    transition: box-shadow 0.3s ease;
}

.breaking-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.trending-item {
    transition: background-color 0.2s ease;
}

.trending-item:hover {
    background-color: var(--surface2);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prose {
    max-width: 65ch;
    color: var(--text);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: var(--text);
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose h1 {
    font-size: 2rem;
}

.prose h2 {
    font-size: 1.5rem;
}

.prose h3 {
    font-size: 1.25rem;
}

.prose p {
    margin-top: 1em;
    margin-bottom: 1em;
    line-height: 1.75;
}

.prose a {
    color: var(--primary);
    text-decoration: underline;
}

.prose a:hover {
    color: var(--accent);
}

.prose img {
    border-radius: 0.5rem;
    margin: 1.5em 0;
}

.prose blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1em;
    margin-left: 0;
    font-style: italic;
    color: var(--text-muted);
}

.prose ul,
.prose ol {
    padding-left: 1.5em;
    margin: 1em 0;
}

.prose li {
    margin: 0.5em 0;
}

.dark .prose-invert {
    color: var(--text);
}

.dark .prose-invert h1,
.dark .prose-invert h2,
.dark .prose-invert h3,
.dark .prose-invert h4 {
    color: var(--text);
}

.dark .prose-invert a {
    color: var(--accent);
}

.dark .prose-invert blockquote {
    border-left-color: var(--primary);
    color: var(--text-muted);
}

.skeleton {
    background: linear-gradient(90deg,
            var(--surface) 0%,
            var(--surface2) 50%,
            var(--surface) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

[x-cloak] {
    display: none !important;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@layer utilities {
    .scrollbar-thin {
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
    }

    .scrollbar-thin::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .scrollbar-thin::-webkit-scrollbar-track {
        background: transparent;
    }

    .scrollbar-thin::-webkit-scrollbar-thumb {
        background-color: var(--border);
        border-radius: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {

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

.focus-ring:focus {
    outline: none;
    ring: 2px;
    ring-offset: 2px;
    ring-color: var(--primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background-color: transparent;
}

.btn-outline:hover {
    background-color: var(--surface2);
}

.input {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--surface);
    color: var(--text);
    transition: border-color 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    ring: 2px;
    ring-color: var(--primary);
}

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

.card {
    background-color: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text);
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--surface2);
}

.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

.toast-success {
    border-color: #10B981;
    background-color: rgba(16, 185, 129, 0.1);
}

.toast-error {
    border-color: #EF4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
}

.backdrop-blur-xl {
    backdrop-filter: blur(20px);
}

.tcol {
    color: white;
}