:root {
    --bg-color: #050505;
    --surface-color: rgba(20, 20, 20, 0.7);
    --surface-hover: rgba(35, 35, 35, 0.8);
    --glass-border: rgba(212, 175, 55, 0.15);
    --primary: #D4AF37;
    --primary-glow: rgba(212, 175, 55, 0.4);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --nav-height: 65px;
    --header-height: 60px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* App-like feel */
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Mobile height */
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

/* Auth / Login Screen */
.glass-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-color);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}
.glass-screen.active {
    display: flex;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.2);
    padding: 0.25rem;
    border-radius: 12px;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}
.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px var(--primary-glow);
}
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}
.tab-content.active {
    display: block;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}
.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Header */
.app-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo {
    width: 28px;
    height: 28px;
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}
.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

/* Main Content Area */
.content-area {
    flex: 1;
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    overflow-y: auto;
    position: relative;
}

/* Views (Pages) */
.view {
    display: none;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}
.view.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}
.badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Sites List */
.sites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.site-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.site-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.site-url {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    word-break: break-all;
}
.site-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}
.site-status.published { color: var(--success); }
.site-status.published .dot { background-color: var(--success); }
.site-status.building { color: var(--warning); }
.site-status.building .dot { 
    background-color: var(--warning); 
    animation: pulse 1s infinite alternate;
}
@keyframes pulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; box-shadow: 0 0 8px var(--warning); }
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.site-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--glass-border);
    padding-top: 0.75rem;
}

/* Loaders */
.loader {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 2rem 0;
    animation: pulse 1.5s infinite;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 1.5rem);
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px var(--primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 40;
    transition: transform 0.2s ease;
}
.fab:active {
    transform: scale(0.9);
}

/* Forms & Inputs */
.glass-select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    appearance: none;
    text-overflow: ellipsis;
}
.glass-select option {
    background: var(--bg-color);
}
.glass-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.glass-input:focus {
    border-color: var(--primary);
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-secondary:active { transform: scale(0.98); }

/* File Explorer */
.file-breadcrumbs {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    word-break: break-all;
}
.file-explorer {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s;
}
.file-item:last-child { border-bottom: none; }
.file-item:active { background: var(--surface-hover); }
.file-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
}
.file-info { flex: 1; overflow: hidden; }
.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.file-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Terminal Logs */
.terminal-container {
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 55vh;
}
.terminal-header {
    background: #111;
    padding: 0.75rem 1rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}
.clear-btn { background: none; border: none; color: #888; cursor: pointer; }
.terminal-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #ccc;
    scroll-behavior: smooth;
}
.log-line { margin-bottom: 0.25rem; word-break: break-all; }
.log-line.info { color: #D4AF37; }
.log-line.success { color: #10B981; }
.log-line.warn { color: #F59E0B; }
.log-line.error { color: #EF4444; }

/* Status text for logs */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}
.status-indicator .dot.idle { background-color: var(--text-secondary); }
.status-indicator .dot.active { background-color: var(--primary); animation: pulse 1s infinite alternate; }

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.2s;
    width: 60px;
}
.nav-item svg { transition: transform 0.2s, stroke 0.2s; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke: var(--primary); transform: translateY(-2px); }

/* Deploy Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0; right: 0;
    background: var(--bg-color);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 1.5rem;
    z-index: 100;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    border-top: 1px solid var(--glass-border);
}
.bottom-sheet.active { bottom: 0; }
.sheet-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 0 auto 1.5rem;
}
.sheet-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 1.5rem;
}
