@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #e8e8ed;
    --text-secondary: #8a8a9a;
    --text-muted: #5a5a6a;
    --accent-cyan: #00d4ff;
    --accent-pink: #ff3d8a;
    --accent-orange: #ff6b35;
    --match-green: #22c55e;
    --differ-red: #ef4444;
    --missing-yellow: #f59e0b;
    --border-color: #2a2a3a;
    --card-bg: rgba(18, 18, 26, 0.8);
}

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

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: -1;
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-screen.visible {
    display: flex;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.4s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--accent-orange), #cc5528);
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    display: none;
    padding: 0.875rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: var(--differ-red);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-error.visible {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-auth {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-orange), #cc5528);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

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

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.free-credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--match-green);
    margin-top: 1rem;
}

/* ==================== APP SCREEN ==================== */
.app-screen {
    display: none;
}

.app-screen.visible {
    display: block;
}

/* User Header Bar */
.user-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.user-header-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.submissions-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 61, 138, 0.2));
    border: 1px solid rgba(255, 107, 53, 0.3);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submissions-badge:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 61, 138, 0.3));
}

.submissions-badge .count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-orange);
}

.submissions-badge .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

.btn-history {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

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

.btn-signout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.btn-signout:hover {
    border-color: var(--differ-red);
    color: var(--differ-red);
}

/* ==================== MAIN CONTENT ==================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 61, 138, 0.2));
    border: 1px solid rgba(255, 107, 53, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-top: 1rem;
}

.section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    position: relative;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.section-title .step {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

/* Locked Overlay */
.locked-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 26, 0.98);
    border-radius: 12px;
    z-index: 100;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.locked-overlay.visible {
    display: flex;
}

.locked-content {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 300px;
}

/* Make section taller when locked overlay is visible */
.section:has(.locked-overlay.visible) {
    min-height: 280px;
}

.locked-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.locked-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.locked-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.locked-contact {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-cyan), #0099cc);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bg-primary);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
}

.locked-contact:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

/* Contact Modal Message */
.contact-message {
    text-align: center;
    padding: 1rem 0;
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-message p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.contact-message .contact-note {
    font-size: 0.9rem;
    color: var(--match-green);
    font-weight: 500;
}

/* HEIC Modal */
.heic-message {
    text-align: center;
    padding: 1rem 0;
}

.heic-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.heic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.heic-options {
    text-align: left;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.heic-option {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.heic-option:last-child {
    border-bottom: none;
}

.heic-option strong {
    color: var(--accent-cyan);
}

.btn-heic-ok {
    background: linear-gradient(135deg, var(--accent-orange), #cc5528);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
}

.btn-heic-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--accent-orange);
    background: rgba(255, 107, 53, 0.05);
}

.upload-zone.dragover {
    border-color: var(--accent-orange);
    background: rgba(255, 107, 53, 0.1);
}

.upload-zone.has-file {
    border-color: var(--match-green);
    border-style: solid;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.preview-row {
    display: none;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.preview-row.visible {
    display: flex;
}

.preview-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.preview-info {
    flex: 1;
}

.preview-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.preview-details {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-clear {
    background: transparent;
    border: 1px solid var(--differ-red);
    color: var(--differ-red);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear:hover {
    background: var(--differ-red);
    color: white;
}

.metadata-preview {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

.metadata-preview h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.metadata-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

.metadata-item .key {
    color: var(--accent-orange);
    min-width: 80px;
}

.metadata-item .value {
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-orange), #cc5528);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled):not(.locked) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.btn-primary:disabled,
.btn-primary.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    width: 100%;
}

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

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

.success-message {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    color: var(--match-green);
    margin-top: 1rem;
}

.success-message.visible {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Compare Section */
.compare-section {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.compare-section.active {
    opacity: 1;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.upload-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.upload-card.has-image {
    border-color: var(--match-green);
}

.card-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.card-label .badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
}

.upload-card:first-child .badge {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.upload-card:last-child .badge {
    background: var(--accent-pink);
    color: white;
}

.mini-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.5rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.85rem;
}

.mini-upload-zone:hover {
    border-color: var(--text-muted);
}

.mini-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.mini-preview {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.mini-preview.visible {
    display: flex;
}

.mini-preview img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 6px;
}

.mini-preview .file-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
    text-align: center;
}

.mini-btn-clear {
    background: transparent;
    border: 1px solid var(--differ-red);
    color: var(--differ-red);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

.btn-compare {
    background: linear-gradient(135deg, var(--accent-cyan), #0099cc);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    margin-top: 1rem;
    width: 100%;
}

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

/* Results */
.results {
    display: none;
    margin-top: 1.5rem;
}

.results.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.summary-card.match .summary-value { color: var(--match-green); }
.summary-card.differ .summary-value { color: var(--differ-red); }
.summary-card.missing .summary-value { color: var(--missing-yellow); }

.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-dot.match { background: var(--match-green); }
.legend-dot.differ { background: var(--differ-red); }
.legend-dot.missing { background: var(--missing-yellow); }

.category {
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.category-header {
    padding: 0.6rem 1rem;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.compare-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
}

.compare-table td {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: top;
}

.compare-table .key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.compare-table .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.compare-table tr.match td { background: rgba(34, 197, 94, 0.08); }
.compare-table tr.differ td { background: rgba(239, 68, 68, 0.1); }
.compare-table tr.missing td { background: rgba(245, 158, 11, 0.08); }

.compare-table tr.match .key { color: var(--match-green); }
.compare-table tr.differ .key { color: var(--differ-red); }
.compare-table tr.missing .key { color: var(--missing-yellow); }

.category-content.collapsed {
    display: none;
}

/* Download Section */
.download-section {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 2px solid var(--match-green);
}

.download-section.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.download-section h4 {
    margin-bottom: 0.75rem;
    color: var(--match-green);
}

.download-instructions {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.save-instructions {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.save-instruction {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
}

.save-instruction strong {
    color: var(--text-primary);
}

.download-preview {
    background: #000;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.download-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    -webkit-touch-callout: default !important;
    -webkit-user-select: auto !important;
    user-select: auto !important;
}

.download-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-download {
    flex: 1;
    min-width: 150px;
    background: var(--match-green);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.3);
}

.btn-share {
    display: none;
    flex: 1;
    min-width: 150px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.download-filename {
    margin-top: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==================== HISTORY MODAL ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.modal-overlay.visible {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.history-loading,
.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.history-icon {
    font-size: 1.5rem;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .user-header-content {
        flex-wrap: wrap;
    }
    
    .user-info {
        flex-wrap: wrap;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-row {
        flex-direction: column;
        text-align: center;
    }
    
    .summary {
        grid-template-columns: 1fr;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-preview img {
        max-height: 300px;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
}

