/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #141824;
    --bg-tertiary: #1a1f2e;
    --bg-card: #1e2433;

    --text-primary: #ffffff;
    --text-secondary: #a0a8b8;
    --text-tertiary: #6b7280;

    --accent-primary: #10b981;
    --accent-secondary: #3b82f6;
    --accent-tertiary: #8b5cf6;

    --border-color: #2d3548;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

/* ===== Mobile Frame ===== */
.mobile-frame {
    width: 100%;
    max-width: 390px;
    height: 844px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 0 0 8px #1e2433, 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Status Bar ===== */
.status-bar {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-primary);
    z-index: 100;
    flex-shrink: 0;
}

.status-bar .time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-icons {
    display: flex;
    gap: 6px;
}

/* ===== Page Container ===== */
.page {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 80px;
    background: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all var(--transition-base);
    padding: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 10;
}

.page::-webkit-scrollbar {
    width: 4px;
}

.page::-webkit-scrollbar-track {
    background: transparent;
}

.page::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.page-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.back-btn {
    position: absolute;
    left: 0;
    top: 4px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: var(--bg-tertiary);
    transform: translateX(-2px);
}

.add-btn {
    position: absolute;
    right: 0;
    top: 4px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* ===== Buttons ===== */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

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

.action-btn.primary:hover {
    background: #0ea172;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 var(--spacing-sm);
    z-index: 100;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-width: 60px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-item.active svg {
    transform: scale(1.1);
}

/* ===== Card Styles ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Responsive ===== */
@media (max-width: 430px) {
    body {
        padding: 0;
    }

    .mobile-frame {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}
