/* ===== CSS Variables ===== */
:root {
    --bg-color: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #334155;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }

/* ===== Typography ===== */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

/* ===== Container ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== Language Switcher ===== */
.lang-switch {
    display: flex;
    align-items: center;
}

.lang-switch button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.lang-switch button:hover { color: var(--accent); }
.lang-switch button.active { color: var(--accent); font-weight: 600; }
.lang-switch .divider { color: var(--text-muted); margin: 0 2px; }

/* ===== User Profile ===== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.user-name {
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Screens ===== */
.screen {
    min-height: 100vh;
    padding-top: 60px;
}

/* ===== Login Screen ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.login-header h1 {
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
}

.login-note {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-google {
    width: 100%;
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.btn-google:hover {
    background: #f5f5f5;
    box-shadow: var(--shadow);
}

/* ===== Dashboard ===== */
.dashboard-header {
    padding: 40px 0 30px;
    background: linear-gradient(135deg, var(--bg-color), var(--bg-card));
}

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

.dashboard-main {
    padding: 30px 0 60px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.projects-icon { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.active-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.requests-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Dashboard Sections ===== */
.dashboard-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
}

/* ===== Projects Grid ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-card h3 {
    margin-bottom: 8px;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-completed {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

/* ===== Requests List ===== */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-item {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.request-item:hover {
    border-color: var(--accent);
}

.request-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.request-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-state p {
    font-size: 1rem;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.modal-backdrop.show { opacity: 1; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 480px;
    width: 100%;
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-backdrop.show .modal {
    transform: translateY(0);
}

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

.modal-header h3 { margin: 0; }

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: var(--text-muted);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Language Visibility ===== */
html[lang="en"] .lang-sl { display: none !important; }
html[lang="sl"] .lang-en { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .user-name { display: none; }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-right {
        gap: 8px;
    }
    
    .lang-switch button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* ===== Safe Areas (for notched devices) ===== */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .dashboard-main {
        padding-bottom: max(60px, env(safe-area-inset-bottom));
    }
}
