/* index.css */
/* anim8 - Upload page styles: hero, drop zone, preview grid, and controls. */

/* --- Hero --- */

.hero {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* --- Drop Zone --- */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}

.drop-zone:hover,
.drop-zone--active {
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: 0 0 30px var(--accent-glow);
}

.drop-zone__icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.drop-zone__prompt p {
    margin: 0.25rem 0;
}

.drop-zone__hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Preview Area --- */

.preview-area {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease;
}

.preview-area h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.reorder-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.preview-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color var(--transition);
    cursor: grab;
    aspect-ratio: 1;
}

.preview-card:active {
    cursor: grabbing;
}

.preview-card.dragging {
    opacity: 0.4;
    border-color: var(--accent);
}

.preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-card__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--danger);
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.preview-card:hover .preview-card__remove {
    opacity: 1;
}

/* --- Controls --- */

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.speed-control input[type="range"] {
    width: 140px;
    accent-color: var(--accent);
}

.duration-label {
    min-width: 3.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Inline Result --- */

.result {
    text-align: center;
    margin-top: 2.5rem;
    animation: fadeIn 0.5s ease;
}

.result h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.gif-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: inline-block;
    max-width: 100%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.gif-display img {
    display: block;
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius-sm);
}

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

/* --- Info Button --- */

.info-btn {
    margin-top: 0.75rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all var(--transition);
}

.info-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* --- Modal --- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 520px;
    width: 100%;
    padding: 2rem;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease;
}

.modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition);
}

.modal__close:hover {
    color: var(--text);
    background: var(--surface);
}

.modal__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.modal__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal__card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}

.modal__icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 0.3rem;
}

.modal__card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.modal__card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
