/* ===== CSS Variables - Neo Brutalism ===== */
:root {
    /* Colors */
    --black: #0a0a0a;
    --black-light: #1a1a1a;
    --red-dark: #8B0000;
    --red: #B22222;
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --white: #FAFAFA;
    --gray: #888888;

    /* Neo Brutalism */
    --border-width: 4px;
    --shadow-offset: 6px;
    --shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
    --shadow-gold: var(--shadow-offset) var(--shadow-offset) 0 var(--gold);
    --shadow-red: var(--shadow-offset) var(--shadow-offset) 0 var(--red-dark);

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1000px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--black);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Container ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--black);
    border-bottom: var(--border-width) solid var(--white);
    padding: 16px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: var(--border-width) solid transparent;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
}

/* ===== Hero Section ===== */
.hero {
    padding: 140px 0 40px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--black);
    padding: 8px 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border: var(--border-width) solid var(--black);
    box-shadow: 3px 3px 0 var(--black);
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 16px;
}

.text-accent {
    color: var(--red);
    position: relative;
}

.text-accent::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--gold);
    z-index: -1;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Tool Section ===== */
.tool-section {
    padding: 60px 0;
}

/* ===== Upload Card ===== */
.upload-card {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.15s ease;
}

.upload-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 var(--red-dark);
}

.upload-card.dragover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: var(--red-dark);
    border: var(--border-width) solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 4px 4px 0 var(--gold);
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.upload-card h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-card p {
    color: var(--gray);
    margin-bottom: 32px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: var(--border-width) solid var(--white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--red-dark);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--white);
}

.btn-secondary {
    background: var(--black);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--gold);
    color: var(--black);
}

/* ===== Processing Card ===== */
.processing-card {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--black);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-card h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.processing-card p {
    color: var(--gray);
    margin-bottom: 24px;
}

.progress-bar {
    height: 12px;
    background: var(--black);
    border: 2px solid var(--white);
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gold);
}

/* ===== Results Section ===== */
.results-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.results-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    padding: 20px 32px;
    text-align: center;
    box-shadow: var(--shadow-red);
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-actions {
    display: flex;
    gap: 12px;
}

/* ===== Tutorials Preview ===== */
.tutorials-preview {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    padding: 24px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.preview-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--black);
    border: var(--border-width) solid var(--gray);
    padding: 10px 16px;
    min-width: 280px;
}

.search-box:focus-within {
    border-color: var(--gold);
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--gray);
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 0.95rem;
    width: 100%;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--gray);
}

.tutorials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.tutorials-list::-webkit-scrollbar {
    width: 8px;
}

.tutorials-list::-webkit-scrollbar-track {
    background: var(--black);
}

.tutorials-list::-webkit-scrollbar-thumb {
    background: var(--gold);
}

.tutorial-card {
    background: var(--black);
    border: var(--border-width) solid var(--gray);
    padding: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tutorial-card:hover {
    border-color: var(--gold);
    transform: translateX(4px);
}

.tutorial-card h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tutorial-card .category-badge {
    display: inline-block;
    background: var(--red-dark);
    color: var(--white);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tutorial-card .preview-text {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 24px;
}

.modal-content {
    background: var(--black-light);
    border: var(--border-width) solid var(--white);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 10px 0 var(--red-dark);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: var(--border-width) solid var(--white);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    padding-right: 24px;
}

.modal-close {
    background: var(--black);
    border: var(--border-width) solid var(--white);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.modal-close:hover {
    background: var(--red-dark);
}

.modal-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--black);
    padding: 8px 16px;
    margin: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-body {
    padding: 0 24px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body h1,
.modal-body h2,
.modal-body h3 {
    font-family: var(--font-display);
    color: var(--white);
    margin: 24px 0 12px;
}

.modal-body h1 {
    font-size: 1.5rem;
}

.modal-body h2 {
    font-size: 1.25rem;
    color: var(--gold);
}

.modal-body h3 {
    font-size: 1.1rem;
}

.modal-body p {
    color: var(--gray);
    margin-bottom: 12px;
}

.modal-body ul,
.modal-body ol {
    color: var(--gray);
    margin: 12px 0;
    padding-left: 24px;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-body blockquote {
    border-left: 4px solid var(--gold);
    padding-left: 16px;
    color: var(--gray);
    font-style: italic;
}

.modal-body hr {
    border: none;
    border-top: 2px solid var(--gray);
    margin: 24px 0;
}

/* ===== Footer ===== */
.footer {
    background: var(--red-dark);
    border-top: var(--border-width) solid var(--white);
    padding: 32px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-logo {
    height: 36px;
    width: auto;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-stats {
        justify-content: center;
    }

    .results-actions {
        justify-content: center;
    }

    .tutorials-list {
        grid-template-columns: 1fr;
    }

    .search-box {
        min-width: 100%;
    }

    .nav {
        gap: 4px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}