/* ============================================
   ZenData - Premium Dark Theme Stylesheet
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: rgba(20, 20, 50, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f0ff;
    --text-secondary: #9090b0;
    --text-muted: #606080;

    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --accent-gradient: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc);

    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(124, 58, 237, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Animated Background --- */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2), transparent);
    bottom: -50px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.15), transparent);
    top: 50%;
    left: 30%;
    animation-delay: -14s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.95); }
    75% { transform: translate(20px, 50px) scale(1.05); }
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.logo-text {
    letter-spacing: -0.5px;
}

.logo-highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--accent-glow);
    border: 1px solid var(--border-glow);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    z-index: 1;
    padding: 140px 24px 60px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-secondary);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto 40px;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-subtitle strong {
    color: var(--green);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Search Bar --- */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.search-input {
    width: 100%;
    padding: 18px 50px 18px 52px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    outline: none;
    transition: var(--transition);
}

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

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-glow);
}

.search-input:focus ~ .search-icon {
    color: var(--accent-secondary);
}

.search-clear {
    position: absolute;
    right: 16px;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-glass-hover);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-clear:hover {
    background: var(--red);
    color: white;
}

.search-clear.visible {
    display: flex;
}

/* --- Stats Bar --- */
.stats-bar {
    position: relative;
    z-index: 1;
    padding: 20px 24px;
}

.stats-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 40px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* --- Datasets Section --- */
.datasets-section {
    position: relative;
    z-index: 1;
    padding: 40px 24px 80px;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Loading --- */
.loading-state {
    text-align: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.loader {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.loader-ring {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: loaderBounce 1.2s infinite ease-in-out;
}

.loader-ring:nth-child(2) {
    animation-delay: 0.1s;
    background: var(--accent-secondary);
}

.loader-ring:nth-child(3) {
    animation-delay: 0.2s;
    background: #c084fc;
}

@keyframes loaderBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* --- Datasets Grid --- */
.datasets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* --- Dataset Card --- */
.dataset-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.5s ease both;
}

.dataset-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

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

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 50px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    padding: 20px;
}

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

.card-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.card-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.card-download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.card-download-btn svg {
    width: 16px;
    height: 16px;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

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

.footer-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: var(--shadow-card);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast.success {
    border-color: var(--green);
}

.toast.error {
    border-color: var(--red);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        padding: 120px 16px 40px;
    }

    .hero-title {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }

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

    .search-input {
        padding: 14px 44px 14px 46px;
        font-size: 0.9rem;
    }

    .stats-container {
        gap: 20px;
        padding: 16px 20px;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .datasets-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .datasets-section {
        padding: 24px 16px 60px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .nav-link {
        padding: 6px 14px;
        font-size: 0.82rem;
    }

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .card-image {
        height: 160px;
    }

    .stats-container {
        flex-direction: column;
        gap: 12px;
    }
}
