/* CSS Variables matching iOS AppTheme */
:root {
    --primary: #F59C00;
    --background: #000000;
    --surface: #1C1C1E;
    --surface-elevated: #2C2C2E;
    --separator: #38383A;
    --text-primary: #FFFFFF;
    --text-secondary: #98989D;
    --text-tertiary: rgba(152, 136, 157, 0.5);
    --danger: #FF3B30;
    --success: #34C759;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Auth Screen */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #000000 0%, #1C1C1E 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    background: var(--surface-elevated);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--surface);
    color: var(--text-primary);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--separator);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.2s;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    opacity: 0.9;
}

.btn-large {
    padding: 14px 24px;
}

.auth-forgot {
    text-align: center;
    font-size: 12px;
    margin: 8px 0 0;
}

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

.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
}

.auth-message.error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.auth-message.success {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Main App */
.main-app {
    min-height: 100vh;
    background: var(--background);
    padding-bottom: 80px;
}

.hidden {
    display: none !important;
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(28, 28, 30, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--separator);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--surface-elevated);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: #000000;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Feed */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-post {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    border: 0.5px solid var(--separator);
}

.feed-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.feed-post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.feed-post-author {
    flex: 1;
}

.feed-post-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.feed-post-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.feed-post-subject {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feed-post-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feed-post-actions {
    display: flex;
    gap: 16px;
    border-top: 0.5px solid var(--separator);
    padding-top: 12px;
}

.feed-post-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    transition: color 0.2s;
}

.feed-post-action:hover {
    color: var(--text-primary);
}

/* Loading & Empty States */
.feed-loading, .feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feed-empty h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feed-empty p {
    color: var(--text-secondary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 28, 30, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--separator);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    z-index: 100;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: color 0.2s;
}

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

.nav-tab-icon {
    font-size: 20px;
}

.nav-tab-label {
    font-size: 10px;
}

.nav-tab-badge {
    position: absolute;
    top: 4px;
    right: 12px;
    background: var(--primary);
    color: #000000;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menu */
.menu-container {
    padding: 16px;
}

.menu-header {
    margin-bottom: 32px;
}

.menu-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.menu-header p {
    color: var(--text-secondary);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.menu-item {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    border: 0.5px solid var(--separator);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.menu-item:hover {
    transform: translateY(-2px);
    background: var(--surface-elevated);
}

.menu-item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.menu-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 640px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 12px;
    }
}