/* Guard Bot - Refactored Web App Styles */

/* ==================== CSS Variables ==================== */
:root {
    /* Light Theme (Default) */
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Gradients & Colors */
    --gradient-purple: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
    --gradient-blue: linear-gradient(135deg, #93C5FD 0%, #3B82F6 100%);
    --gradient-green: linear-gradient(135deg, #A7F3D0 0%, #10B981 100%);
    --gradient-orange: linear-gradient(135deg, #FDBA74 0%, #F97316 100%);
    --gradient-pink: linear-gradient(135deg, #F9A8D4 0%, #EC4899 100%);
    --gradient-teal: linear-gradient(135deg, #6EE7B7 0%, #0D9488 100%);
    --purple-vivid: #8B5CF6;
    --green-vivid: #10B981;
    --blue-vivid: #3B82F6;
    --pink-vivid: #EC4899;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-fab: 0 12px 40px rgba(59, 130, 246, 0.3);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
:root[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-card: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    /* Gradients & Colors */
    --gradient-purple: linear-gradient(135deg, #5B21B6 0%, #4C1D95 100%);
    --gradient-blue: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
    --gradient-green: linear-gradient(135deg, #065F46 0%, #064E3B 100%);
    --gradient-orange: linear-gradient(135deg, #92400E 0%, #78350F 100%);
    --gradient-pink: linear-gradient(135deg, #9D174D 0%, #831843 100%);
    --gradient-teal: linear-gradient(135deg, #0D9488 0%, #134E4A 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-fab: 0 12px 40px rgba(59, 130, 246, 0.5);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    padding-bottom: 100px;
}

/* Theme transition animation */
body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
    transition: background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base) !important;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ==================== Container ==================== */
#app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-md);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Header ==================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--bg-primary);
}

.user-details h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.user-details p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

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

.gradient-card {
    color: white;
    padding: var(--spacing-xl);
    border: none;
}
.gradient-card * { color: white !important; }

/* ==================== Feature Grid ==================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.feature-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    font-size: 1.75rem;
}
.feature-card h3 { font-size: 0.95rem; }
.feature-card p { font-size: 0.75rem; color: var(--text-muted); }

/* Card Colors */
.gradient-card.purple, .feature-card.purple .feature-icon { background: var(--gradient-purple); }
.gradient-card.blue, .feature-card.blue .feature-icon { background: var(--gradient-blue); }
.gradient-card.green, .feature-card.green .feature-icon { background: var(--gradient-green); }
.gradient-card.orange, .feature-card.orange .feature-icon { background: var(--gradient-orange); }
.gradient-card.pink, .feature-card.pink .feature-icon { background: var(--gradient-pink); }
.gradient-card.teal, .feature-card.teal .feature-icon { background: var(--gradient-teal); }

/* ==================== Progress Bar ==================== */
.progress-container {
    margin: var(--spacing-md) 0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-green);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--blue-vivid);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-full { width: 100%; }

/* ==================== Bottom Navigation ==================== */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid var(--bg-primary);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: var(--spacing-xs);
}
.nav-btn svg { width: 24px; height: 24px; stroke: currentColor; }
.nav-btn span { font-size: 0.75rem; font-weight: 500; }
.nav-btn.active { color: var(--blue-vivid); }

.fab {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    box-shadow: var(--shadow-fab);
    position: relative;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.fab:hover { transform: scale(1.1); }
.fab svg { width: 28px; height: 28px; stroke: white; fill: white; }

/* ==================== Loading & Empty States ==================== */
.loading, .empty-state {
    text-align: center;
    padding: var(--spacing-xl);
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--blue-vivid);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== Responsive ==================== */
@media (max-width: 380px) {
    html { font-size: 14px; }
    .feature-grid { grid-template-columns: 1fr; }
    #app-container { padding: var(--spacing-sm); }
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.5); }
