/* App Shell - Core Structure and Dark Theme */

:root {
    /* Default colors - will be overridden by themes.css */
    /* Theme variables are defined in themes.css */
    
    /* Layout variables (not theme-dependent) */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.7);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Layout */
    --header-height: 44px;
    --status-bar-height: 24px;
    --tab-bar-height: 50px;
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    
    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}


/* App Container */
.app-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    transition: opacity 0.3s ease-out;
}


/* Status Bar */
.status-bar {
    height: var(--status-bar-height);
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    font-size: 12px;
    padding-top: var(--safe-area-top);
}

.status-icons {
    display: flex;
    gap: var(--spacing-xs);
}

/* App Header */
.app-header {
    height: var(--header-height);
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;  /* No background, seamless with content */
    border-bottom: none;  /* No border */
}

.header-back,
.header-menu {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.header-back:active,
.header-menu:active {
    background: var(--bg-secondary);
}

.header-back.hidden {
    opacity: 0;
    pointer-events: none;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
}

/* Main Content Area */
.app-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Screen Container */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: none;
    opacity: 0;
}

.screen.active {
    display: block;
    opacity: 1;
}

.screen.prev {
    display: none;
}

/* Tab Bar */
.tab-bar {
    height: var(--tab-bar-height);
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-secondary);  /* Use theme variable */
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.tab-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);  /* More visible white */
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 8px 0;
}

.tab-item.active {
    color: var(--accent-primary);  /* Gold when active */
}

.tab-item:active {
    opacity: 0.8;
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    display: block;
}

.tab-label {
    font-size: 11px;
    font-weight: 500;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: var(--text-secondary);
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

/* Responsive for larger screens */
@media (min-width: 768px) {
    .app-container {
        max-width: 428px;
        margin: 0 auto;
        box-shadow: var(--shadow-lg);
    }
}