/* WRUW - What aRe yoU Wearing? */
:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666;
    --border: #e5e5e5;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --max-width: 1200px;
    --header-height: 64px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.logo span { color: var(--accent); }

.tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 12px;
    display: none;
}

@media (min-width: 640px) {
    .tagline { display: inline; }
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.upload-btn:hover { background: var(--accent-hover); }

.upload-btn svg { width: 18px; height: 18px; }

/* Stats bar */
.stats-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Gallery Grid */
.gallery-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

@media (max-width: 640px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .gallery-container { padding: 8px; }
}

.watch-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.watch-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.watch-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.watch-card .card-info {
    padding: 10px 12px;
}

.watch-card .brand-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watch-card .model-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watch-card .country-flag {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text);
}

/* Upload Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h2 { font-size: 1.125rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    line-height: 1;
}

.modal-body { padding: 20px; }

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.04);
}

.drop-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

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

.drop-zone .browse-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

.drop-zone.has-preview {
    padding: 0;
    border-style: solid;
    border-color: var(--accent);
}

.drop-zone.has-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}

/* Form fields */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

.submit-btn:hover { background: var(--accent-hover); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Upload progress */
.upload-progress {
    display: none;
    text-align: center;
    padding: 20px;
}

.upload-progress.active { display: block; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
}

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

/* Success message */
.upload-success {
    display: none;
    text-align: center;
    padding: 20px;
}

.upload-success.active { display: block; }

.upload-success .check-icon {
    width: 64px;
    height: 64px;
    color: var(--success);
    margin-bottom: 12px;
}

.upload-success h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.uuid-link {
    display: block;
    background: #f5f5f5;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    word-break: break-all;
    margin: 12px 0;
    font-family: monospace;
    color: var(--accent);
    text-decoration: none;
}

.uuid-link:hover { background: #ebebeb; }

.copy-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 300;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-info {
    color: white;
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* Error message */
.error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--danger);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 400;
    transition: transform 0.3s;
    max-width: 90%;
    text-align: center;
}

.error-toast.visible { transform: translateX(-50%) translateY(0); }

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.email-info {
    margin-top: 6px;
    font-size: 0.8rem;
}

.email-info a {
    color: var(--accent);
    text-decoration: none;
}
