/* FotoHunt - ArnariFotografie */
/* Mobile-first responsive design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #141419;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --accent-gold: #f0a500;
    --accent-orange: #ff6b35;
    --text-primary: #ffffff;
    --text-secondary: #8b8b9a;
    --text-muted: #5a5a6a;
    --success: #4ade80;
    --danger: #ef4444;
    --border: #2a2a35;
    --beginner: #22c55e;
    --easy: #3b82f6;
    --intermediate: #f59e0b;
    --advanced: #ef4444;
    --expert: #a855f7;
    --professional: #ec4899;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-gold); border-radius: 2px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pointsFloat { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }

.fade-in { animation: fadeIn 0.3s ease-out; }

/* AUTH */
.auth-container {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.auth-logo { font-size: 64px; margin-bottom: 16px; }
.auth-title {
    font-size: 28px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px;
}
.auth-subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }
.auth-form { width: 100%; max-width: 360px; }
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input {
    width: 100%; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; color: var(--text-primary); font-size: 16px; font-family: inherit; transition: all 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.1); }
.form-input::placeholder { color: var(--text-muted); }
.auth-switch { text-align: center; margin-top: 20px; color: var(--text-secondary); font-size: 14px; }
.auth-switch a { color: var(--accent-gold); text-decoration: none; font-weight: 600; }
.error-message {
    background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger);
    padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; display: none;
}
.error-message.active { display: block; }
.loading {
    display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; border-top-color: white; animation: spin 0.8s linear infinite;
    margin-left: 8px; vertical-align: middle;
}

/* NAV */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-secondary);
    border-top: 1px solid var(--border); display: flex; justify-content: space-around;
    padding: 8px 0; z-index: 1000; backdrop-filter: blur(20px);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 16px; color: var(--text-muted); text-decoration: none; font-size: 11px;
    transition: all 0.2s; border: none; background: none; cursor: pointer; font-family: inherit;
}
.nav-item.active { color: var(--accent-gold); }
.nav-item svg { width: 24px; height: 24px; transition: transform 0.2s; }

/* HEADER */
.app-header { padding: 16px 20px 8px; background: var(--bg-primary); position: sticky; top: 0; z-index: 100; }
.app-title {
    font-size: 24px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.app-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.fire-icon {
    position: absolute; top: 16px; right: 20px; width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 16px; box-shadow: 0 4px 12px rgba(240, 165, 0, 0.3);
}

.content { padding: 0 16px 100px; max-width: 600px; margin: 0 auto; }

/* LEVEL CARD */
.level-card {
    background: var(--bg-card); border-radius: 20px; padding: 24px; margin: 16px 0;
    border: 1px solid var(--border); position: relative; overflow: hidden;
}
.level-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-orange));
}
.level-header { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.level-ring { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.level-ring svg { transform: rotate(-90deg); width: 80px; height: 80px; }
.level-ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.level-ring-progress {
    fill: none; stroke: url(#gradient); stroke-width: 6; stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}
.level-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 28px; }
.level-info h2 { font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.level-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.level-desc { font-size: 13px; color: var(--text-secondary); }
.level-points { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; }
.current-points { color: var(--accent-gold); font-weight: 700; }
.next-level { color: var(--text-muted); font-size: 12px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stat-card {
    background: var(--bg-card); border-radius: 16px; padding: 16px 12px;
    text-align: center; border: 1px solid var(--border); transition: transform 0.2s;
}
.stat-card:active { transform: scale(0.96); }
.stat-icon { width: 32px; height: 32px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 18px; }
.stat-icon.green { background: rgba(74, 222, 128, 0.15); }
.stat-icon.gold { background: rgba(240, 165, 0, 0.15); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); }
.stat-value { font-size: 24px; font-weight: 800; margin-bottom: 2px; }
.stat-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* SECTIONS */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; padding: 0 4px; }
.section-title { font-size: 16px; font-weight: 700; }
.section-link { color: var(--accent-gold); font-size: 13px; text-decoration: none; display: flex; align-items: center; gap: 4px; }

.empty-state {
    background: var(--bg-card); border-radius: 20px; padding: 40px 24px;
    text-align: center; border: 1px solid var(--border); margin: 16px 0;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-text { font-size: 14px; color: var(--text-secondary); }

/* LEVEL PATH */
.level-path { margin: 16px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.level-path::-webkit-scrollbar { display: none; }
.path-container { display: flex; gap: 16px; padding: 8px 4px; min-width: max-content; }
.path-item { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 64px; opacity: 0.4; transition: all 0.3s; }
.path-item.active { opacity: 1; transform: scale(1.1); }
.path-item.completed { opacity: 0.8; }
.path-icon {
    width: 48px; height: 48px; border-radius: 50%; background: var(--bg-card);
    border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
    font-size: 20px; position: relative;
}
.path-item.active .path-icon { border-color: var(--accent-gold); box-shadow: 0 0 20px rgba(240, 165, 0, 0.3); }
.path-item.completed .path-icon { border-color: var(--success); background: rgba(74, 222, 128, 0.1); }
.path-name { font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; }
.path-item.active .path-name { color: var(--accent-gold); }

/* MISSIONS */
.missions-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.mission-card {
    background: var(--bg-card); border-radius: 16px; padding: 16px;
    border: 1px solid var(--border); position: relative; overflow: hidden;
    transition: all 0.3s; cursor: pointer;
}
.mission-card:active { transform: scale(0.98); }
.mission-card.locked { opacity: 0.6; }
.mission-card.completed {
    border-color: rgba(74, 222, 128, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(74, 222, 128, 0.05));
}
.mission-card.completed::after {
    content: '✓'; position: absolute; top: 16px; right: 16px;
    width: 24px; height: 24px; background: var(--success); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: white; font-weight: 700;
}
.mission-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.mission-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.mission-card.completed .mission-icon { background: rgba(74, 222, 128, 0.15); }
.mission-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; padding-right: 32px; }
.mission-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.mission-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.difficulty-badge {
    padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.difficulty-badge.beginner { background: rgba(34, 197, 94, 0.15); color: var(--beginner); }
.difficulty-badge.easy { background: rgba(59, 130, 246, 0.15); color: var(--easy); }
.difficulty-badge.intermediate { background: rgba(245, 158, 11, 0.15); color: var(--intermediate); }
.difficulty-badge.advanced { background: rgba(239, 68, 68, 0.15); color: var(--advanced); }
.difficulty-badge.expert { background: rgba(168, 85, 247, 0.15); color: var(--expert); }
.difficulty-badge.professional { background: rgba(236, 72, 153, 0.15); color: var(--professional); }
.category-badge {
    padding: 4px 10px; border-radius: 20px; font-size: 11px;
    background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border);
}
.points-badge { margin-left: auto; color: var(--accent-gold); font-weight: 700; font-size: 14px; }
.mission-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.completed-text { color: var(--success); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* UPLOAD */
.upload-area {
    border: 2px dashed var(--border); border-radius: 20px; padding: 40px 24px;
    text-align: center; margin: 16px 0; transition: all 0.3s; cursor: pointer; background: var(--bg-card);
}
.upload-area:active { border-color: var(--accent-gold); background: var(--bg-card-hover); }
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.upload-hint { font-size: 13px; color: var(--text-secondary); }
.preview-image { width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; margin: 16px 0; display: none; }

.btn-primary {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    border: none; border-radius: 16px; color: white; font-size: 16px;
    font-weight: 700; cursor: pointer; margin-top: 16px; transition: all 0.2s; font-family: inherit;
}
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    width: 100%; padding: 16px; background: transparent; border: 1px solid var(--border);
    border-radius: 16px; color: var(--text-primary); font-size: 16px;
    font-weight: 600; cursor: pointer; margin-top: 12px; font-family: inherit;
}

/* PHOTO GRID */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.photo-item { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-card); position: relative; cursor: pointer; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-item:active img { transform: scale(1.1); }
.photo-overlay {
    position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex; align-items: flex-end; padding: 8px; opacity: 0; transition: opacity 0.2s;
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-points { font-size: 12px; font-weight: 700; color: var(--accent-gold); }

/* PROFILE */
.profile-header {
    text-align: center; padding: 32px 24px 24px; background: var(--bg-card);
    border-radius: 0 0 24px 24px; margin: -16px -16px 16px;
    border-bottom: 1px solid var(--border); position: relative;
}
.profile-avatar {
    width: 100px; height: 100px; border-radius: 50%; background: var(--bg-secondary);
    margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
    font-size: 48px; border: 3px solid var(--accent-gold); position: relative;
}
.profile-avatar::after {
    content: ''; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid transparent; border-top-color: var(--accent-gold); border-right-color: var(--accent-orange);
    animation: spin 3s linear infinite;
}
.profile-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-email { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.profile-level {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px; background: var(--bg-secondary);
    border-radius: 20px; font-size: 13px; font-weight: 700;
}
.profile-level .level-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-gold); }

/* PROGRESS LIST */
.progress-list { background: var(--bg-card); border-radius: 20px; padding: 20px; margin: 16px 0; border: 1px solid var(--border); }
.progress-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.progress-item:last-child { border-bottom: none; }
.progress-item.current { background: rgba(240, 165, 0, 0.1); margin: 0 -20px; padding: 12px 20px; border-radius: 12px; border-bottom: none; }
.progress-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; background: var(--bg-secondary); flex-shrink: 0; }
.progress-item.current .progress-icon { background: var(--accent-gold); color: var(--bg-primary); }
.progress-item.completed .progress-icon { background: var(--success); color: white; }
.progress-info { flex: 1; }
.progress-name { font-size: 14px; font-weight: 600; }
.progress-item.current .progress-name { color: var(--accent-gold); }
.progress-points { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.progress-item.current .progress-points { color: var(--accent-gold); }
.progress-item.completed .progress-points { color: var(--success); }

.logout-btn {
    width: 100%; padding: 16px; background: transparent; border: 1px solid var(--danger);
    border-radius: 16px; color: var(--danger); font-size: 16px; font-weight: 600;
    cursor: pointer; margin: 24px 0; display: flex; align-items: center;
    justify-content: center; gap: 8px; font-family: inherit; transition: all 0.2s;
}
.logout-btn:active { background: rgba(239, 68, 68, 0.1); }

/* MODAL */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px); z-index: 2000; display: none;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card); border-radius: 24px; padding: 24px;
    width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto;
    border: 1px solid var(--border); animation: fadeIn 0.3s ease-out;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 20px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%; background: var(--bg-secondary);
    border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.modal-close:active { background: var(--border); }

/* FILTERS */
.filter-tabs {
    display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 8px 0; margin: 8px 0 16px;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-secondary); font-size: 13px;
    font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; transition: all 0.2s;
}
.filter-tab.active { background: var(--accent-gold); color: var(--bg-primary); border-color: var(--accent-gold); }
.filter-tab:active { transform: scale(0.95); }

/* SUCCESS */
.success-animation {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9);
    z-index: 3000; display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
}
.success-animation.active { display: flex; }
.success-circle {
    width: 120px; height: 120px; border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #22c55e);
    display: flex; align-items: center; justify-content: center;
    font-size: 60px; animation: pulse 0.5s ease-out;
}
.success-text { font-size: 24px; font-weight: 800; color: var(--success); }
.success-points { font-size: 18px; color: var(--accent-gold); }

/* LEADERBOARD */
.leaderboard-item {
    display: flex; align-items: center; gap: 12px; padding: 16px;
    background: var(--bg-card); border-radius: 16px; margin-bottom: 8px; border: 1px solid var(--border);
}
.leaderboard-rank {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #000; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #000; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #b87333); color: #fff; }
.rank-other { background: var(--bg-secondary); color: var(--text-secondary); }
.leaderboard-info { flex: 1; }
.leaderboard-name { font-weight: 700; font-size: 15px; }
.leaderboard-level { font-size: 12px; color: var(--text-secondary); }
.leaderboard-points { font-size: 18px; font-weight: 800; color: var(--accent-gold); }

/* MISC */
input[type="file"] { display: none; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease-out; }
.lock-icon {
    position: absolute; top: 16px; right: 16px; width: 24px; height: 24px;
    background: var(--bg-secondary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--text-muted);
}
.time-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.points-float {
    position: fixed; color: var(--accent-gold); font-weight: 800; font-size: 24px;
    pointer-events: none; z-index: 4000; animation: pointsFloat 1s ease-out forwards;
}

/* RESPONSIVE */
@media (max-width: 380px) {
    .stats-grid { gap: 8px; }
    .stat-card { padding: 12px 8px; }
    .stat-value { font-size: 20px; }
}
