/* ========================================
   Cyber Garage Tech Xchange - Mobile App
   ======================================== */

/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables - Dark Theme */
:root {
    --primary-color: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary-color: #6c757d;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #1a1a1a;
    --dark-color: #0a0a0a;
    --white: #ffffff;
    --black: #000000;

    --body-bg: #121212;
    --card-bg: #1a1a1a;
    --input-bg: #242424;
    --text-color: #e5e5e5;
    --text-muted: #9ca3af;
    --border-color: #2d2d2d;

    --header-height: 56px;
    --footer-height: 60px;
    --spacing: 16px;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Header & Navigation
   ======================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.app-header .logo {
    font-size: 1.25rem;
    font-weight: 600;
}

.app-header .logo a {
    color: var(--white);
}

/* Menu Toggle Button */
.menu-toggle {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: 0.3s;
}

/* Side Navigation */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1001;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--card-bg);
    transition: 0.3s;
    z-index: 1002;
    overflow-y: auto;
}

.side-nav.active {
    left: 0;
}

.nav-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px var(--spacing);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.nav-header h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.nav-header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.nav-menu {
    list-style: none;
    padding: var(--spacing) 0;
}

.nav-menu li {
    border-bottom: 1px solid var(--border-color);
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 14px var(--spacing);
    color: var(--text-color);
    transition: background 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--input-bg);
    color: var(--primary-light);
}

.nav-menu .icon {
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

/* ========================================
   Main Content
   ======================================== */
.app-content {
    padding: var(--spacing);
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-body {
    padding: var(--spacing);
}

.card-footer {
    padding: var(--spacing);
    border-top: 1px solid var(--border-color);
    background: var(--input-bg);
}

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

.btn-block {
    display: flex;
    width: 100%;
}

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

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

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

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: var(--spacing);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ========================================
   Lists
   ======================================== */
.list {
    list-style: none;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.list-item {
    padding: var(--spacing);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.list-item .content {
    flex: 1;
}

.list-item .title {
    font-weight: 500;
}

.list-item .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   Footer / Bottom Navigation
   ======================================== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 600px;
}

.footer-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.2s;
}

.footer-nav a.active,
.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-nav .icon {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.footer-nav .icon-wrapper {
    position: relative;
    display: inline-block;
}

.footer-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
    border: 2px solid var(--card-bg);
    animation: pulse-badge 2s infinite;
}

.footer-badge-green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.5);
    animation: none;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.hidden { display: none; }

/* ========================================
   Alerts
   ======================================== */
.alert {
    padding: var(--spacing);
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ========================================
   Loading Spinner
   ======================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (min-width: 768px) {
    .app-content {
        padding: 24px;
    }

    .container {
        max-width: 720px;
    }
}

/* ========================================
   Auth Pages (Login/Signup)
   ======================================== */
.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2.5rem;
}

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.auth-logo p {
    color: var(--text-muted);
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card .form-control {
    padding: 14px 16px;
    font-size: 1rem;
}

.auth-card .btn {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
}

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

.auth-divider span {
    padding: 0 16px;
    font-size: 0.875rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-light);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.social-login {
    display: flex;
    gap: 12px;
}

.social-login .btn {
    flex: 1;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.social-login .btn:hover {
    background: var(--border-color);
}

.password-toggle {
    position: relative;
}

.password-toggle .toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.remember-forgot label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-forgot input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.remember-forgot a {
    color: var(--primary-light);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 52px;
    height: 28px;
    background: var(--input-bg);
    border-radius: 14px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success-color);
    border-color: var(--success-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.toggle-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Subscription Alert */
.subscription-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
}

.subscription-alert.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.subscription-alert.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.subscription-alert.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.subscription-alert.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.subscription-alert .sub-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.subscription-alert .sub-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subscription-alert .sub-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.subscription-alert .sub-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.subscription-alert .sub-action {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
}

.subscription-alert .sub-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Stats Grid (2x2)
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: var(--spacing);
}

.stat-card {
    background: rgba(59, 130, 246, 0.08);
    border-radius: 16px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    font-weight: 500;
}

/* ========================================
   Available to Work Card
   ======================================== */
.available-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.available-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.available-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
}

.available-card .card-body {
    position: relative;
    z-index: 1;
}

.available-card .toggle-label {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.available-card #availableStatus {
    font-size: 0.875rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}
