/**
 * ============================================================================
 * BEX-BOX.RU DASHBOARD - MAIN CSS
 * ============================================================================
 * Datei: assets/css/main.css
 * Version: 1.0.0
 * ============================================================================
 */

/* ============================================================================
   CSS VARIABLES (Light Theme Default)
   ============================================================================ */
:root {
    /* Colors - Light Theme */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e4e6eb;
    
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-tertiary: #8a8d91;
    
    --accent-primary: #FF7700;
    --accent-secondary: #ff9500;
    --accent-hover: #e66a00;
    
    --border-color: #dddfe2;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Telegram-style Gradient */
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-modal: 200;
    --z-tooltip: 300;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Telegram-Style Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    background-attachment: fixed;
    opacity: 0.05;
    z-index: -1;
}

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

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

ul,
ol {
    list-style: none;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   HEADER
   ============================================================================ */
.dashboard-header {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-img {
    width: 40px;
    height: 40px;
}

.logo-text a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.logo-text a:hover {
    color: var(--accent-primary);
}

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--border-color);
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar,
.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-avatar-placeholder {
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Buttons */
.btn-login,
.btn-logout {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
}

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

.btn-login:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-logout {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.25rem;
    padding: var(--spacing-sm);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: #ff4444;
    color: white;
}

/* ============================================================================
   TABS NAVIGATION
   ============================================================================ */
.tabs-navigation {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    display: flex;
    gap: var(--spacing-xs);
    overflow-x: auto;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.tab-button {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    white-space: nowrap;
}

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

.tab-button.active {
    background: var(--accent-primary);
    color: white;
}

.tab-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.tab-label {
    margin-left: var(--spacing-xs);
}

/* ============================================================================
   TAB CONTENT
   ============================================================================ */
.tab-content {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px var(--shadow-color);
    margin-bottom: var(--spacing-md);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) * 2;
    gap: var(--spacing-md);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================================================
   FOOTER
   ============================================================================ */
.dashboard-footer {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-separator {
    margin: 0 var(--spacing-sm);
    color: var(--border-color);
}

.footer-link {
    color: var(--accent-primary);
}

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

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

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    .dashboard-header,
    .tabs-navigation,
    .dashboard-footer,
    .theme-toggle,
    .user-info,
    .btn-logout {
        display: none !important;
    }
    
    .dashboard-container {
        max-width: 100%;
        padding: 0;
    }
    
    .tab-content {
        box-shadow: none;
        border-radius: 0;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
