:root {
    --primary: #009EE2;
    --primary-dark: #001F89;
    --accent: #00f2ff;
    --bg-dark: #0a0f1d;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #e0e6ed;
    --text-dim: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, #001F89 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, #009EE2 0%, transparent 40%);
    opacity: 0.15;
    z-index: -1;
    filter: blur(100px);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.icon-pulse {
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

h1 span {
    color: var(--primary);
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    font-weight: 300;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.card {
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-content {
    padding: 2.5rem;
}

.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(0, 158, 226, 0.05);
}

.upload-icon {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.upload-area h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.file-info {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.file-name {
    font-size: 0.85rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-file {
    background: none;
    border: none;
    color: var(--error);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    transition: border-color 0.3s ease;
}

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

.primary-btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 158, 226, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 158, 226, 0.4);
}

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

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #444;
    box-shadow: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

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

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

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.success-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.5rem;
    border-radius: 50%;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.secondary-btn {
    margin: 0 2rem 2rem 2rem;
    width: calc(100% - 4rem);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

footer {
    text-align: center;
    padding-top: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out forwards;
}

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

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

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

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

    .storyline-selector {
        grid-template-columns: 1fr !important;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 158, 226, 0.3);
}

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

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

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

/* Section Title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.section-desc {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* Storyline Selector */
.storyline-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.storyline-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.storyline-card:hover:not(.disabled) {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.storyline-card.selected {
    border-color: var(--primary);
    background: rgba(0, 158, 226, 0.1);
    box-shadow: 0 0 20px rgba(0, 158, 226, 0.2);
}

.storyline-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.storyline-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.storyline-badge.available {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.storyline-badge.coming-soon {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-dim);
}

.storyline-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.storyline-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.storyline-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Analyzer Options */
.analyzer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analyzer-options .input-group {
    flex: 1;
    min-width: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    accent-color: var(--primary);
}

/* Progress Container */
.progress-container {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-text {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 2rem 2rem 2rem;
}

.download-buttons .secondary-btn {
    flex: 1;
    min-width: 140px;
    margin: 0;
    width: auto;
}

/* Stats Grid - 3 columns for analyzer */
#analysis-result-card .stats-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
    #analysis-result-card .stats-grid {
        grid-template-columns: 1fr;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-buttons .secondary-btn {
        width: 100%;
    }
}

/* Link Card - Navigation to Analyzer */
.link-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0, 158, 226, 0.15);
}

.link-card-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.link-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.link-info {
    flex: 1;
    text-align: left;
}

.link-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.25rem 0;
}

.link-info p {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin: 0;
}

.link-arrow {
    color: var(--primary);
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.link-card:hover .link-arrow {
    opacity: 1;
    transform: translateX(5px);
}

@media (max-width: 480px) {
    .link-card-content {
        flex-direction: column !important;
        text-align: center;
        gap: 1rem;
    }

    .link-info {
        text-align: center;
    }

    .link-arrow {
        display: none;
    }
}
/* Validation Status */
.validation-status {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

.validation-status.valid {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.validation-status.invalid {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.validation-status.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.validation-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.validation-message {
    flex: 1;
}

.validation-message strong {
    display: block;
    margin-bottom: 0.25rem;
}

.validation-details {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.validation-details code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Language Toggle */
.lang-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem;
    border-radius: 8px;
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--text-main);
}

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