/* ========================================
   Anki Card Generator - Custom Styles
   Pico CSS override / supplement
   ======================================== */

/* --- Tab Navigation --- */
nav ul li .tab-link {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    color: var(--pico-muted-color);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

nav ul li .tab-link:hover {
    color: var(--pico-primary);
}

nav ul li .tab-link.active {
    color: var(--pico-primary);
    border-bottom-color: var(--pico-primary);
    font-weight: bold;
}

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

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

/* --- Progress Bar --- */
#section-progress progress {
    width: 100%;
    margin-bottom: 0.5rem;
}

#progress-text {
    text-align: center;
    margin-bottom: 0.25rem;
}

#progress-count {
    display: block;
    text-align: center;
    color: var(--pico-muted-color);
}

/* --- Download Section --- */
#section-download details {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#section-download details summary {
    cursor: pointer;
    color: var(--pico-muted-color);
    font-size: 0.9rem;
}

#section-download details ol {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
}

#section-download details code {
    font-size: 0.8rem;
    word-break: break-all;
}

#download-link {
    display: inline-block;
    margin-bottom: 1rem;
}

/* --- Error Section --- */
#error-message {
    color: var(--pico-del-color);
    font-weight: bold;
}

#error-details {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: var(--pico-muted-color);
}

#error-details:empty {
    display: none;
}

/* --- Section Visibility --- */
section[hidden] {
    display: none !important;
}

/* --- Form Layout --- */
#section-input article > nav {
    margin-bottom: 1.5rem;
}

/* --- Form hint text --- */
.tab-content small {
    display: block;
    margin-bottom: 1.5rem;
}

#section-input article > nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

#section-input article > nav ul li {
    padding: 0;
    margin: 0;
}

/* --- File Input --- */
input[type="file"] {
    padding: 0.5rem;
}

/* --- File Format Example --- */
#form-file details {
    margin-top: 1.25rem;
}

/* --- Button Spacing --- */
#section-download .outline,
#section-error .outline {
    margin-top: 0.5rem;
}

/* --- Mobile Adjustments --- */
@media (max-width: 576px) {
    .grid {
        grid-template-columns: 1fr;
    }

    nav ul li .tab-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }

    textarea {
        rows: 6;
    }
}

/* --- Loading State (disabled button with spinner feel) --- */
button[aria-busy="true"] {
    opacity: 0.7;
    pointer-events: none;
}
