/* ============================================
   DEBT FREE MILLIONAIRE - WEB EDITION
   Main Stylesheet
   ============================================ */

:root {
    /* Colors */
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --secondary-dark: #059669;
    --accent: #F59E0B;
    --danger: #EF4444;
    --success: #22C55E;

    /* Neutrals */
    --bg-dark: #0F172A;
    --bg-medium: #1E293B;
    --bg-light: #334155;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

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

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

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

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

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

/* ============================================
   SCREENS - Base styles moved to screens.css
   ============================================ */

/* ============================================
   LOADING SCREEN
   ============================================ */

#loading-screen {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
}

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

.loading-content h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
}

.loading-bar {
    width: 300px;
    height: 6px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto var(--spacing-md);
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   MAIN MENU
   ============================================ */

.menu-container {
    text-align: center;
    padding: var(--spacing-xl);
}

.game-title {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
}

.game-subtitle {
    color: var(--text-secondary);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xl);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
}

.menu-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--bg-light);
    border-radius: var(--radius-lg);
    background: var(--bg-medium);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 250px;
    transition: all var(--transition-normal);
}

.menu-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.menu-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
}

.menu-btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.menu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   CHARACTER SELECTION
   ============================================ */

.panel-container {
    background: var(--bg-medium);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 800px;
    width: 90%;
}

.panel-container.wide {
    max-width: 1000px;
}

.panel-container h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.character-card {
    background: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition-normal);
}

.character-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
}

.character-card.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.2);
    box-shadow: var(--shadow-glow);
}

.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto var(--spacing-sm);
    background: var(--bg-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.character-avatar.male1 { background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%); }
.character-avatar.male2 { background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%); }
.character-avatar.male3 { background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%); }
.character-avatar.female1 { background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%); }
.character-avatar.female2 { background: linear-gradient(135deg, #F97316 0%, #EA580C 100%); }
.character-avatar.female3 { background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%); }

.character-avatar::after {
    content: '👤';
    font-size: 2rem;
}

.character-card span {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   CAREER SELECTION
   ============================================ */

/* Industry Selection Grid */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
}

.industry-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background: var(--bg-light);
    border: 3px solid var(--bg-light);
    border-radius: var(--radius-lg);
    cursor: not-allowed;
    transition: all var(--transition-normal);
    opacity: 0.4;
    filter: grayscale(100%);
    font-family: inherit;
}

.industry-btn.available {
    opacity: 1;
    filter: none;
    cursor: pointer;
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-medium) 100%);
}

.industry-btn.available:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.industry-btn.available:active {
    transform: translateY(-2px);
}

.industry-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

.industry-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.industry-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: var(--spacing-md);
}

/* Legacy career styles (kept for future use) */
.career-details {
    background: var(--bg-dark);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    text-align: left;
    min-height: 120px;
}

.career-details h3 {
    color: var(--primary-light);
    margin-bottom: var(--spacing-sm);
}

.career-details p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-sm);
}

.career-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--bg-light);
}

.career-details .detail-row:last-child {
    border-bottom: none;
}

.career-details .detail-label {
    color: var(--text-muted);
}

.career-details .detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.career-details .detail-value.money {
    color: var(--secondary);
}

/* ============================================
   OVERLAYS & MODALS
   ============================================ */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.overlay.active {
    display: flex;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-medium);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* How to Play */
.instructions {
    margin-bottom: var(--spacing-lg);
}

.instruction-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--bg-light);
}

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

.instruction-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.instruction-item h4 {
    color: var(--primary-light);
    margin-bottom: var(--spacing-xs);
}

.instruction-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   SIDE PANELS
   ============================================ */

.side-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: var(--bg-medium);
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    z-index: 50;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.side-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--bg-light);
}

.panel-header h3 {
    font-size: 1.3rem;
}

.close-btn {
    background: var(--bg-light);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

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

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.finance-section, .investment-section {
    margin-bottom: var(--spacing-lg);
}

.finance-section h4, .investment-section h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.big-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
}

.finance-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    color: var(--text-secondary);
}

.debt-list, .expense-list, .stock-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.debt-item, .expense-item, .stock-item {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.debt-item .debt-name, .expense-item .expense-name {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.debt-item .debt-amount {
    color: var(--danger);
    font-weight: 600;
}

.expense-item .expense-amount {
    color: var(--accent);
    font-weight: 600;
}

/* Objectives */
.objectives-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.objective-item {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.objective-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.objective-name {
    font-weight: 500;
}

.objective-target {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.objective-progress {
    height: 8px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.objective-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

/* ============================================
   PAYDAY OVERLAY
   ============================================ */

.payday-container {
    background: var(--bg-medium);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s ease-out;
}

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

.payday-container h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    color: var(--accent);
}

.paycheck {
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.paycheck-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--bg-light);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.paycheck-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
}

.paycheck-row.deduction span:last-child {
    color: var(--danger);
}

.paycheck-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.paycheck-row.total span:last-child {
    color: var(--secondary);
}

.paycheck-divider {
    height: 1px;
    background: var(--bg-light);
    margin: var(--spacing-sm) 0;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
