/**
 * WhiteGen228 - Main Styles
 */

/* ==================== Variables ==================== */
:root {
    --bg-body: #1a1b23;
    --bg-primary: #22232d;
    --bg-secondary: #2a2b38;
    --bg-tertiary: #32333f;
    --bg-hover: #3a3b4a;
    --bg-card: #2a2b38;
    
    --text-primary: #e8e9ed;
    --text-secondary: #a0a3b1;
    --text-muted: #6b6e7d;
    
    --accent: #7c5cff;
    --accent-light: #9d85ff;
    --accent-dark: #5a3fd6;
    --accent-bg: rgba(124, 92, 255, 0.12);
    
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.12);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.12);
    
    --border: #3a3b4a;
    --border-light: #32333f;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow: 0 4px 16px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.35);
    
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    --transition: all 0.15s ease;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', 'Consolas', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

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

.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 50%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Layout ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-lg {
    max-width: 1400px;
}

.container-sm {
    max-width: 800px;
}

main {
    flex: 1;
    padding: 40px 0;
}

/* ==================== Header ==================== */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--accent-light);
    background: var(--accent-bg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

/* Language Switcher - Simple */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.lang-switch a {
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.lang-switch a:hover {
    color: var(--text-primary);
}

.lang-switch a.active {
    color: var(--accent-light);
    background: var(--accent-bg);
}

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

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.user-menu-btn:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-chevron {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-menu.open .user-chevron {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 9999;
    overflow: hidden;
}

.user-menu.open .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
}

.user-menu-dropdown a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-menu-dropdown a span {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.user-menu-dropdown a.logout {
    color: var(--error);
}

.user-menu-dropdown a.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ==================== Footer ==================== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 60px;
}

.footer-brand p {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 18px;
    transition: var(--transition);
}

.footer-socials a:hover {
    background: var(--accent-bg);
    color: var(--accent-light);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-light);
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
    transform: translateY(-1px);
}

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

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

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #2eb882;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--accent-light);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-bg);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
}

.form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-error {
    color: var(--error);
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-primary {
    background: var(--accent-bg);
    color: var(--accent-light);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

/* ==================== Alerts ==================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

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

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .container { padding: 0 16px; }
    
    .header-nav { display: none; }
    
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ==================== Toast Notifications ==================== */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-color: var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-color: var(--error);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-info {
    border-color: var(--accent);
}

.toast-info .toast-icon {
    color: var(--accent-light);
}

