/* ==================== CSS CUSTOM PROPERTIES ==================== */
:root {
    --color-bg: #0a0a1a;
    --color-surface: rgba(15, 15, 35, 0.8);
    --color-surface-alt: rgba(20, 20, 45, 0.7);
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-primary-soft: rgba(99, 102, 241, 0.15);
    --color-accent: #a78bfa;
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    --color-glass-bg: rgba(255, 255, 255, 0.03);
    --color-glass-border: rgba(255, 255, 255, 0.06);
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-danger: #ef4444;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
    --color-bg: #f8fafc;
    --color-surface: rgba(255, 255, 255, 0.8);
    --color-surface-alt: rgba(255, 255, 255, 0.7);
    --color-primary: #4f46e5;
    --color-primary-hover: #6366f1;
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-border: rgba(0, 0, 0, 0.06);
    --color-border-hover: rgba(0, 0, 0, 0.12);
    --color-glass-bg: rgba(255, 255, 255, 0.5);
    --color-glass-border: rgba(0, 0, 0, 0.05);
    --color-shadow: rgba(0, 0, 0, 0.05);
}

/* ==================== RESET & BASE ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

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

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

button {
    font: inherit;
    cursor: pointer;
    border: none;
    color: inherit;
}

input {
    font: inherit;
}

/* ==================== UTILS ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==================== GLASS CARD ==================== */
.glass-card {
    background: var(--color-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 8px 32px var(--color-shadow);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: 0.01em;
    background: transparent;
}

.btn--primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn--primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

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

.btn--outline:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn--ghost:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

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

.btn--danger:hover {
    opacity: 0.9;
}

.btn--icon {
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.btn--lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn--sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

/* Ripple effect */
.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    padding-top: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    opacity: 1;
    pointer-events: none;
}

.ripple:active::after {
    transform: scale(2.5);
    opacity: 0;
    transition: transform 0.6s, opacity 0.6s;
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 10, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}

[data-theme="light"] .header {
    background: rgba(248, 250, 252, 0.7);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.3rem;
}

.nav__logo-icon svg {
    display: block;
}

.nav__logo-text {
    background: linear-gradient(135deg, #a78bfa, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search bar */
.search-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: var(--color-surface);
}

.search-bar.active {
    max-height: 70px;
}

.search-bar__inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
}

.search-bar__input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.95rem;
    outline: none;
}

.search-bar__input::placeholder {
    color: var(--color-text-secondary);
}

/* ==================== HERO ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 7rem 0 5rem;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    animation: float 12s infinite alternate ease-in-out;
}

.hero__orb--1 {
    width: 500px;
    height: 500px;
    background: #6366f1;
    top: -150px;
    left: -100px;
}

.hero__orb--2 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    bottom: -100px;
    right: -50px;
    animation-delay: -4s;
}

.hero__orb--3 {
    width: 300px;
    height: 300px;
    background: #a78bfa;
    top: 40%;
    right: 10%;
    animation-delay: -8s;
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1);
    }
    100% {
        transform: translateY(-30px) scale(1.1);
    }
}

.hero__content {
    position: relative;
    text-align: center;
    max-width: 800px;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero__badge-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
}

.hero__title {
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero__title-gradient {
    background: linear-gradient(135deg, #a78bfa, #6366f1, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__desc {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero__stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.hero__stat {
    text-align: center;
}

.hero__stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.hero__stat-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.hero__scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    opacity: 0.6;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ==================== SECTIONS ==================== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

/* Upload */
.upload-section {
    padding: 5rem 0;
}

.upload-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 2.5rem;
}

.upload-card__inner {
    text-align: center;
}

.upload-card__icon {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.upload-card__label {
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary);
}

.plugin-container {
    margin: 1.5rem auto;
    display: flex;
    justify-content: center;
    min-height: 80px;
    align-items: center;
}

.upload-card__hint {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* Generated Links */
.generated-section {
    padding: 3rem 0;
}

.generated-links-grid {
    display: grid;
    gap: 1.25rem;
}

.link-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    transition: all var(--transition);
}

.link-card:hover {
    border-color: var(--color-primary);
}

.link-card__label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    min-width: 120px;
}

.link-card__value {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--color-glass-bg);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    word-break: break-all;
    color: var(--color-text);
}

.link-card__copy {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    transition: transform var(--transition);
}

.link-card__copy:hover {
    transform: scale(1.05);
}

.link-card__copy.copied {
    background: var(--color-success);
    animation: pop 0.3s ease;
}

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

/* Recent Uploads */
.recent-section {
    padding: 5rem 0;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recent-empty {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-secondary);
    display: none;
}

.recent-empty.visible {
    display: block;
}

.recent-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.recent-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 25px var(--color-shadow);
}

.recent-card__preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
    background: var(--color-glass-bg);
}

.recent-card__body {
    padding: 1rem;
}

.recent-card__date {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.recent-card__link {
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.recent-card__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Features */
.features-section {
    padding: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.feature-card__icon--blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.feature-card__icon--purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.feature-card__icon--green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.feature-card__icon--orange {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.feature-card__icon--pink {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.feature-card__icon--teal {
    background: rgba(20, 184, 166, 0.2);
    color: #2dd4bf;
}

.feature-card h3 {
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* FAQ */
.faq-section {
    padding: 5rem 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-item__trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    background: transparent;
    transition: background var(--transition);
}

.faq-item__trigger:hover {
    background: var(--color-primary-soft);
}

.faq-item__chevron {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-item__chevron {
    transform: rotate(180deg);
}

.faq-item__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
}

.faq-item.active .faq-item__content {
    max-height: 300px;
    padding: 0 1.5rem 1.25rem;
}

.faq-item__content p {
    color: var(--color-text-secondary);
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer__logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.footer__tagline {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.footer__links {
    display: flex;
    gap: 2rem;
}

.footer__links a {
    color: var(--color-text-secondary);
    transition: color var(--transition);
}

.footer__links a:hover {
    color: var(--color-primary);
}

.footer__copy {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(24px);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal__body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--color-glass-bg);
}

.modal__image {
    max-width: 100%;
    max-height: 70vh;
    transition: transform 0.3s ease;
    object-fit: contain;
}

/* Settings Panel */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.settings-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.settings-panel {
    width: 90%;
    max-width: 480px;
    padding: 1.5rem;
    background: var(--color-surface);
    backdrop-filter: blur(24px);
}

.settings-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
}

.settings-item__label {
    font-weight: 600;
}

.settings-item__desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border);
    border-radius: 28px;
    transition: var(--transition);
}

.toggle-switch__slider::before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-switch__slider {
    background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-switch__slider::before {
    transform: translateX(24px);
}

/* Confirmation Dialog */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.dialog-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.dialog {
    width: 90%;
    max-width: 420px;
    padding: 2rem;
    text-align: center;
}

.dialog__icon {
    margin-bottom: 1rem;
}

.dialog__title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.dialog__desc {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.dialog__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.9rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px var(--color-shadow);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav__logo-text {
        display: none;
    }
    .hero__stats {
        gap: 1.5rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .footer__inner {
        flex-direction: column;
        text-align: center;
    }
    .footer__links {
        justify-content: center;
    }
}