/* ========================================
   AI Alt Text Generator — Accessibility Blue Dark
   ======================================== */
:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --accent: #60A5FA;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #F87171;

    --bg-base: #0F172A;
    --bg-surface: #1E293B;
    --bg-elevated: #273548;
    --bg-input: #1A2437;
    --bg-hover: #334155;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --border: rgba(59, 130, 246, 0.15);
    --border-active: rgba(59, 130, 246, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 200ms ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 25% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 100%, rgba(96, 165, 250, 0.05) 0%, transparent 50%);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
}

.btn-success {
    background: var(--success);
    color: #0F172A;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    background: rgba(30, 41, 59, 0.5);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 24px var(--primary-glow);
}

.drop-zone:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.drop-content {
    pointer-events: none;
}

.drop-icon {
    margin-bottom: 1rem;
}

.drop-zone h2 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.drop-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Style Bar */
.style-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.style-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.style-btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.style-btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

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

/* Results Grid */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: grid;
    grid-template-columns: 200px 1fr;
    animation: slideUp 0.3s ease;
}

.result-image-wrap {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 160px;
}

.result-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-content {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-photo {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.type-illustration {
    background: rgba(168, 85, 247, 0.15);
    color: #A855F7;
}

.type-icon {
    background: rgba(34, 211, 238, 0.15);
    color: #22D3EE;
}

.type-chart {
    background: rgba(251, 191, 36, 0.15);
    color: #FBBF24;
}

.type-unknown {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.file-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alt-text-area {
    font-family: var(--font);
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    resize: vertical;
    min-height: 60px;
    transition: border-color var(--transition);
    outline: none;
    width: 100%;
}

.alt-text-area:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.char-count.warn {
    color: var(--warning);
}

.char-count.good {
    color: var(--success);
}

.result-actions {
    display: flex;
    gap: 0.35rem;
}

/* WCAG Tip */
.wcag-tip {
    font-size: 0.78rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}

.toast-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.toast-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        pointer-events: none;
    }
}

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

    .result-image-wrap {
        max-height: 200px;
    }

    .app-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .drop-zone {
        padding: 2rem 1rem;
    }

    .style-bar {
        flex-wrap: wrap;
    }
}