/* DESIGN SYSTEM & VARIABLES */
:root {
    --bg-dark: #0A0A0F;
    --card-bg: rgba(25, 25, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);

    --text-main: #FFFFFF;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;

    --accent-blue: #2E51A2;
    /* MAL Blue */
    --accent-blue-hover: #3b66c4;
    --accent-blue-glow: rgba(46, 81, 162, 0.5);

    --accent-cyan: #06B6D4;
    /* Complementary Cyan */
    --accent-cyan-glow: rgba(6, 182, 212, 0.4);

    --status-success: #10B981;
    --status-success-bg: rgba(16, 185, 129, 0.1);
    --status-error: #EF4444;
    --status-error-bg: rgba(239, 68, 68, 0.1);
    --status-info: #3B82F6;
    --status-info-bg: rgba(59, 130, 246, 0.1);

    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --radius-md: 12px;
    --radius-lg: 24px;
}

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

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

/* BACKGROUND EFFECTS (GLASSMORPHISM GLOWS) */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: drift 20s infinite ease-in-out alternate;
}

.glow-1 {
    top: -20%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 60%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    background: radial-gradient(circle, var(--accent-blue-glow) 0%, transparent 60%);
    animation-delay: -5s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, -50px) scale(1.1);
    }
}

/* TYPOGRAPHY & LAYOUT */
a {
    color: var(--accent-blue-hover);
    text-decoration: none;
    transition: var(--transition);
}

.mal-import-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-blue-hover);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.05);
    transition: var(--transition);
    text-decoration: none !important;
}

.mal-import-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue-hover);
    color: #fff !important;
    transform: translateY(-2px);
}

.app-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

.gradient-text {
    font-family: 'Bitcount Prop Double', sans-serif;
    font-size: 7rem;
    font-weight: 300;
    background: linear-gradient(135deg, #FFFFFF 0%, #3B82F6 50%, #2E51A2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.4em;
    margin-right: -0.4em;
    /* Compensate for the extra spacing on the last letter */
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.subtitle {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* CARDS */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.card.hidden {
    display: none;
    opacity: 0;
}

/* UTILS */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.hidden {
    display: none !important;
}

/* INSTRUCTIONS GRID */
.instructions {
    margin-bottom: 2.5rem;
}

.instructions h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.step-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.step-card p strong {
    color: var(--text-main);
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent-blue);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

/* DRAG AND DROP ZONE */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: rgba(0, 0, 0, 0.1);
}

.drop-zone:hover,
.drop-zone.drag-active {
    border-color: var(--accent-pink);
    background: rgba(255, 51, 102, 0.05);
}

.drop-zone-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.drop-zone:hover .drop-zone-icon {
    color: var(--accent-pink);
    transform: translateY(-5px);
}

.drop-zone-title {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.drop-zone-prompt {
    font-family: 'Architects Daughter', cursive;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-grid-top {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1rem;
}

.stats-grid-bottom {
    grid-template-columns: repeat(5, 1fr);
}

.stat-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-box.primary .stat-value {
    color: var(--status-success);
}

.stat-box.success {
    border-color: var(--status-success-bg);
}

.stat-box.success .stat-value {
    color: var(--status-success);
}

.stat-box.info {
    border-color: var(--status-info-bg);
}

.stat-box.info .stat-value {
    color: var(--status-info);
}

.stat-box.error {
    border-color: var(--status-error-bg);
}

.stat-box.error .stat-value {
    color: var(--status-error);
}

.ptw-box {
    border-color: rgba(255, 152, 0, 0.2);
}

.ptw-box .stat-value {
    color: #FF9800;
}

.watching-box {
    border-color: rgba(59, 130, 246, 0.2);
}

.watching-box .stat-value {
    color: #3B82F6;
}

.onhold-box {
    border-color: rgba(168, 85, 247, 0.2);
}

.onhold-box .stat-value {
    color: #A855F7;
}

.dropped-box {
    border-color: rgba(255, 255, 255, 0.1);
}

.dropped-box .stat-value {
    color: #A0AEC0;
}

.dropped-box .stat-label,
.dropped-box .stat-value {
    color: #A0AEC0;
}

/* BUTTONS */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.primary-btn {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

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

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 81, 162, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(46, 81, 162, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 81, 162, 0);
    }
}

/* RESULTS ICONS */
.results-header {
    margin-bottom: 3.5rem;
}

.results-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    background: var(--status-success-bg);
    color: var(--status-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

/* SKIPPED SECTION */
.skipped-section {
    margin-top: 3rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--status-error-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.skipped-header {
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--status-error-bg);
}

.skipped-header h3 {
    font-size: 1rem;
    color: var(--status-error);
    margin: 0;
}

.skipped-body {
    padding: 1.5rem;
}

.skipped-reason {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.skipped-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.skipped-list::-webkit-scrollbar {
    width: 6px;
}

.skipped-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.skipped-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.skipped-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.skipped-item:last-child {
    margin-bottom: 0;
}

.skipped-title {
    font-weight: 500;
    margin-right: 1rem;
}

.skipped-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-dim);
}

/* ALERT */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.alert.error {
    background: var(--status-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ffb3b3;
}

.alert-icon {
    flex-shrink: 0;
}

/* SPINNER */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* FOOTER */
.app-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ANIMATIONS */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.slide-up {
    animation: slideUp 0.8s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

@media (max-width: 600px) {
    .app-container {
        padding: 1.5rem 1rem;
    }

    .gradient-text {
        font-size: 2.2rem;
    }

    .card {
        padding: 1.5rem;
    }

    /* Stack stats on smaller mobile screens */
    .stats-grid-top,
    .stats-grid-bottom {
        grid-template-columns: 1fr;
        margin-bottom: 1rem;
    }

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

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .drop-zone {
        padding: 2rem 1.5rem;
    }

    .app-header {
        margin-bottom: 2rem;
    }

    .skipped-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    #download-skipped-btn {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* SUPPORT / BUY ME A COFFEE BUTTON */
.support-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 152, 0, 0.05);
    border: 1px solid rgba(255, 152, 0, 0.2);
    color: #FF9800 !important;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.05);
    transition: var(--transition);
}

.support-btn:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: #FF9800;
    color: #FFF !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.2);
}

.support-icon {
    transition: transform 0.3s ease;
}

.support-btn:hover .support-icon {
    animation: heartBeat 0.8s infinite alternate ease-in-out;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.25);
    }
}