/* CloudTorrent - Enhanced UX Theme */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Colors */
    --black: #0a0a0a;
    --charcoal: #121212;
    --graphite: #1a1a1a;
    --slate: #262626;
    --ash: #333;

    --white: #f5f5f5;
    --silver: #a8a8a8;
    --gray: #6b6b6b;

    --accent: #fbbf24;
    --accent-hover: #fcd34d;
    --red: #ef4444;
    --green: #22c55e;
    --blue: #3b82f6;

    /* Typography - DM Sans for better readability */
    --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    line-height: 1.6;
}

/* Subtle background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Navigation */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--slate);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    text-decoration: none;
    color: var(--white);
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--black);
    font-size: 1.1rem;
    border-radius: 10px;
    font-weight: 700;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-tab {
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--silver);
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s var(--ease);
}

.nav-tab:hover {
    color: var(--white);
    background: var(--graphite);
}

.nav-tab.active {
    color: var(--black);
    background: var(--accent);
}

.nav-tab .badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    background: var(--red);
    color: white;
    border-radius: 10px;
    font-weight: 600;
}

.nav-tab.active .badge {
    background: rgba(0, 0, 0, 0.2);
    color: var(--black);
}

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

.feature-badge {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.feature-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.feature-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.feature-badge i {
    font-size: 0.5rem;
}

/* Main container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Stats bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title i {
    color: var(--accent);
    font-size: 1.3rem;
}

.control-group {
    display: flex;
    gap: 0.5rem;
}

/* Input group */
.input-group-neon {
    display: flex;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--slate);
    background: var(--charcoal);
}

.input-group-neon .input-neon {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.input-neon {
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    font-family: var(--font-main);
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 10px;
    color: var(--white);
    transition: border-color 0.2s;
}

.input-neon::placeholder {
    color: var(--gray);
}

.input-neon:focus {
    outline: none;
    border-color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-main);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--graphite);
    color: var(--white);
    border: 1px solid var(--slate);
}

.btn-secondary:hover {
    background: var(--slate);
    border-color: var(--ash);
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-ghost:hover {
    color: var(--white);
    background: var(--graphite);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
}

/* Select */
.select-input {
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    font-size: 0.875rem;
    font-family: var(--font-main);
    background: var(--graphite);
    border: none;
    color: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a8a8a8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
}

.select-input:focus {
    outline: none;
}

/* Item list */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.item-card {
    padding: 1.25rem;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 12px;
    transition: border-color 0.2s var(--ease);
}

.item-card:hover {
    border-color: var(--ash);
}

.item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    word-break: break-word;
    line-height: 1.4;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.85rem;
    color: var(--silver);
}

.item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.item-meta .speed-indicator {
    color: var(--green);
    font-weight: 500;
}

.item-status {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.status-downloading {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.status-paused,
.status-stopped {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent);
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.status-queued {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

/* Progress bar */
.progress-container {
    margin: 1rem 0;
}

.progress-bar {
    height: 6px;
    background: var(--slate);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 3px;
    transition: width 0.3s var(--ease);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

/* Item actions */
.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--slate);
    margin-top: 0.75rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--slate);
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--silver);
    font-weight: 600;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* File grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
}

.file-card {
    padding: 1.25rem;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 12px;
    transition: all 0.2s var(--ease);
    cursor: pointer;
}

.file-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--graphite);
    border-radius: 10px;
    margin-bottom: 0.85rem;
}

.file-icon.folder {
    color: var(--accent);
}

.file-icon.video {
    color: #f472b6;
}

.file-icon.audio {
    color: var(--green);
}

.file-icon.image {
    color: var(--blue);
}

.file-icon.archive {
    color: #fb923c;
}

.file-icon.document {
    color: #a78bfa;
}

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
    line-height: 1.4;
}

.file-size {
    font-size: 0.8rem;
    color: var(--gray);
    font-family: var(--font-mono);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--silver);
    text-decoration: none;
    transition: color 0.15s;
}

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

.breadcrumb .separator {
    color: var(--gray);
}

.breadcrumb .current {
    color: var(--white);
    font-weight: 600;
}

/* Toast - Editorial style */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    max-width: 400px;
    animation: toastIn 0.3s var(--ease);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

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

.toast.success {
    border-left: 3px solid var(--green);
}

.toast.error {
    border-left: 3px solid var(--red);
}

.toast.info {
    border-left: 3px solid var(--accent);
}

.toast.warning {
    border-left: 3px solid var(--accent);
}

/* Confirm dialog */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.confirm-box {
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 16px;
    padding: 2rem;
    max-width: 380px;
    text-align: center;
}

.confirm-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.confirm-message {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    color: var(--silver);
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 560px;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 16px;
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--slate);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Conversion format */
.conversion-format {
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--accent);
    color: var(--black);
    border-radius: 4px;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* Video player */
.player-wrapper {
    max-width: 100%;
}

.video-info {
    padding: 1.5rem;
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 12px;
    margin-top: 1rem;
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.video-path {
    font-size: 0.85rem;
    color: var(--gray);
    font-family: var(--font-mono);
    word-break: break-all;
}

/* Plyr */
:root {
    --plyr-color-main: var(--accent);
}

.plyr {
    border-radius: 12px;
}

/* Glass card */
.glass-card {
    background: var(--charcoal);
    border: 1px solid var(--slate);
    border-radius: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--slate);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ash);
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-success {
    color: var(--green) !important;
}

.text-warning {
    color: var(--accent) !important;
}

.text-danger {
    color: var(--red) !important;
}

/* Responsive */
@media (max-width: 900px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .logo-text {
        display: none;
    }

    .stats-bar {
        gap: 1rem;
    }

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

    .input-group-neon {
        flex-direction: column;
        border-radius: 10px;
    }

    .input-group-neon .select-input,
    .input-group-neon .btn {
        border-radius: 0;
        width: 100%;
    }

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

    .feature-badge {
        display: none;
    }
}

@media (max-width: 500px) {
    html {
        font-size: 14px;
    }

    .main-container {
        padding: 1rem;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        max-width: 100%;
    }
}