/* CSS переменные для современного дизайна */
:root {
    /* Нейтральная палитра */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    
    /* Текст */
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Границы */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Акценты */
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Радиусы */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Размеры */
    --container-max: 1200px;
    --header-height: 80px;
}

/* Темная тема */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #475569;
    --border-light: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.version-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.theme-icon {
    font-size: 1.25rem;
}

.main {
    min-height: calc(100vh - var(--header-height));
}

.welcome-section {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.welcome-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.welcome-quote {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.125rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.modules-section {
    padding: 4rem 0;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.module-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.module-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.module-card:hover .module-icon {
    transform: scale(1.1);
}

.module-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.module-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.module-quote {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.module-features {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.module-actions {
    display: flex;
    gap: 1rem;
}

.liquid-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.liquid-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.liquid-button:active {
    transform: translateY(0);
}

.liquid-button.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.liquid-button.large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.liquid-button.secondary {
    background: var(--secondary);
}

.liquid-button.secondary:hover {
    background: #7c3aed;
}

.liquid-button.success {
    background: var(--success);
}

.liquid-button.success:hover {
    background: #059669;
}

.features-section {
    padding: 4rem 0;
    background: var(--bg-tertiary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.feature-quote {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info p {
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        gap: 1rem;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .logo-title {
        font-size: 1.25rem;
    }
    
    .logo-subtitle {
        font-size: 0.75rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: 2rem 0;
    }
    
    .modules-section,
    .features-section {
        padding: 2rem 0;
    }
    
    .module-card {
        padding: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 1rem;
}

.auth-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.login-btn {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

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

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

.register-btn:hover {
    background: var(--primary-dark);
}

.modern-auth {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: none;
}

.modern-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.modern-auth:hover::before {
    left: 0;
}

.modern-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.user-info:hover {
    background: var(--border-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1;
}

.user-login {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    overflow: hidden;
}

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

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.dropdown-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-info-detailed {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.user-full-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.2;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.user-login-detailed {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.dropdown-link:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--bg-tertiary);
}

.link-icon {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.user-dropdown .admin-link {
    color: var(--primary);
    font-weight: 500;
}

.user-dropdown .admin-link:hover {
    background: rgba(59, 130, 246, 0.1);
}

.user-dropdown .logout-btn {
    color: var(--warning);
    font-weight: 500;
}

.user-dropdown .logout-btn:hover {
    background: rgba(245, 158, 11, 0.1);
}

/* Responsive для auth элементов */
@media (max-width: 768px) {
    .auth-buttons {
        gap: 8px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .user-menu {
        padding: 6px 8px;
        gap: 10px;
    }
    
    .user-info {
        padding: 0.375rem 0.5rem;
        gap: 0.5rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-role {
        font-size: 10px;
        padding: 0.125rem 0.25rem;
    }
    
    .user-dropdown {
        min-width: 200px;
    }
    
    .user-dropdown a,
    .user-dropdown button {
        padding: 0.625rem 0.875rem;
        font-size: 13px;
    }
    
    .link-icon {
        font-size: 14px;
    }
} 