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

:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --accent-color: #4cc9f0;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --info-color: #60a5fa;
    --gold-color: #ffd700;
    --silver-color: #c0c0c0;
    --bronze-color: #cd7f32;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #ffffff;
    --bg-surface: #f8fafc;
    --border-color: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --shadow-sm: 0 1px 2px 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);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    outline: none;
    user-select: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #6415a0);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.btn-large {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #ef4444);
    color: var(--text-white);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

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

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.input-with-icon .form-input {
    padding-left: 42px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    background: none;
    border: none;
    font-size: 18px;
}

.select-with-icon {
    position: relative;
}

.select-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.select-with-icon select {
    padding-left: 42px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert i {
    font-size: 18px;
    margin-top: 2px;
}

.alert-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.alert-danger {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.error-message {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

/* ===== MODAL WINDOWS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-modal {
    max-width: 420px;
}

.auth-modal .modal-header {
    padding: 30px 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
}

.auth-modal .modal-body {
    padding: 30px;
}

.auth-form {
    display: none;
}

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

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

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

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 14px;
}

.auth-links.center {
    justify-content: center;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 16px;
}

/* ===== APP CONTAINER ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-surface);
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.app-header {
    background: var(--bg-card);
    padding: 16px 24px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    max-width: 100%;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-center {
    text-align: center;
    justify-content: center;
}

.header-right {
    justify-content: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: transparent; /* Убираем градиентный фон */
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    flex-shrink: 0;
    overflow: hidden;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    padding: 4px; 
}
.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 200px;
    max-width: 100%;
}

.user-profile:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badges {
    display: flex;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.user-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: var(--text-white);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.limit-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.limit-badge.warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.limit-badge.danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

.feedback-btn-header {
    background: linear-gradient(135deg, var(--accent-color), var(--info-color));
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.feedback-btn-header:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: white;
}

/* ===== MAIN CONTENT AREA ===== */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    max-width: 100%;
}

.app-sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    overflow-y: auto;
    flex-shrink: 0;
    min-height: calc(100vh - 80px);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: var(--bg-surface);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--bg-surface);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.app-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-width: calc(100% - 240px);
    min-height: calc(100vh - 80px);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: 100%;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    display: none;
    min-height: 100%;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== WELCOME SECTION ===== */
.welcome-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    min-height: 100%;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.section-title i {
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.section-title span {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== CONFIDENTIALITY WARNING ===== */
.confidentiality-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 3px solid #f59e0b;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    max-width: 100%;
}

.confidentiality-warning::before {
    content: '⚠️';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    opacity: 0.2;
}

.confidentiality-warning h4 {
    color: #92400e;
    margin-bottom: 16px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.confidentiality-warning h4 i {
    color: #f59e0b;
    font-size: 20px;
    flex-shrink: 0;
}

.confidentiality-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .confidentiality-list {
        grid-template-columns: 1fr;
    }
}

.confidentiality-list .prohibited,
.confidentiality-list .recommended {
    padding: 20px;
    border-radius: var(--radius-md);
    min-width: 0;
}

.confidentiality-list .prohibited {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.confidentiality-list .recommended {
    background: rgba(25, 135, 84, 0.1);
    border-left: 4px solid #198754;
}

.confidentiality-list strong {
    color: #1e293b;
    margin-bottom: 10px;
    display: block;
    font-size: 15px;
}

.confidentiality-list ul {
    margin: 10px 0 0 20px;
    padding: 0;
    font-size: 14px;
}

.confidentiality-list li {
    margin-bottom: 8px;
    color: #495057;
    line-height: 1.5;
    word-break: break-word;
}

/* ===== ABOUT SECTION ===== */
.about-section {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.about-section::before {
    content: '💬';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    opacity: 0.1;
}

.about-content {
    position: relative;
    z-index: 2;
}

.about-title {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.about-title i {
    color: var(--primary-color);
    font-size: 22px;
    flex-shrink: 0;
}

.about-description {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
    word-break: break-word;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.about-feature {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    min-width: 0;
}

.about-feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.about-feature h5 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.about-feature p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* ===== STATS CARDS ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
    max-width: 100%;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
    word-break: break-all;
}

.stat-card .label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    word-break: break-word;
}

/* ===== NEWS SECTION ===== */
.news-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.news-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    flex-wrap: wrap;
}

.news-title i {
    color: var(--primary-color);
    flex-shrink: 0;
}

.news-container {
    position: relative;
    max-width: 100%;
}

.news-scroll-container {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-surface);
    max-width: 100%;
}

.news-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.news-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: 4px;
}

.news-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.news-grid {
    display: inline-flex;
    gap: 15px;
    max-width: 100%;
}

.news-item {
    flex: 0 0 auto;
    width: 300px;
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    white-space: normal;
    min-width: 0;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.news-date {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.news-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.news-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    word-break: break-word;
}

.news-tag {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    margin-top: 10px;
    white-space: nowrap;
}

.scroll-indicator {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.scroll-arrow {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.scroll-arrow:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.scroll-arrow.left {
    transform: rotate(90deg);
}

.scroll-arrow.right {
    transform: rotate(-90deg);
}

.scroll-arrow.left:hover {
    transform: rotate(90deg) scale(1.1);
}

.scroll-arrow.right:hover {
    transform: rotate(-90deg) scale(1.1);
}

/* ===== TRAINING CONTAINER ===== */
.training-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    margin-top: 24px;
    transition: all 0.5s ease;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .training-container {
        grid-template-columns: 1fr;
    }
}

.scenario-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.5s ease;
    max-width: 100%;
}

.chat-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    transition: all 0.5s ease;
    max-width: 100%;
}

.chat-section.chat-expanded {
    animation: expandChat 0.5s ease;
}

@keyframes expandChat {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== CLIENT TYPE SELECTOR ===== */
.client-type-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
    max-width: 100%;
}

@media (max-width: 768px) {
    .client-type-selector {
        grid-template-columns: 1fr;
    }
}

.client-type-option {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    word-break: break-word;
    min-width: 0;
}

.client-type-option:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.client-type-option.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.client-type-option.random {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--accent-color), var(--info-color));
    color: var(--text-white);
    border-color: var(--accent-color);
}

@media (max-width: 768px) {
    .client-type-option.random {
        grid-column: span 1;
    }
}

/* ===== CHAT INTERFACE ===== */
.chat-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    max-width: 100%;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-status.training-active {
    color: var(--success-color);
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-surface);
    min-height: 400px;
    max-width: 100%;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    line-height: 1.5;
    font-size: 14px;
    position: relative;
    animation: messageSlideIn 0.3s ease;
    word-break: break-word;
    min-width: 0;
}

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

.message.ai {
    background: #e8f5e9;
    color: #1e3a1e;
    border-left: 4px solid #4caf50;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.message.user {
    background: #e3f2fd;
    color: #0d3a69;
    border-right: 4px solid #2196f3;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.chat-input-container {
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    max-width: 100%;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    background: var(--bg-card);
    transition: all var(--transition-fast);
    max-width: calc(100% - 92px);
    word-break: break-word;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.chat-input:disabled {
    background: var(--bg-surface);
    cursor: not-allowed;
}

.chat-controls {
    text-align: center;
    margin-top: 10px;
    max-width: 100%;
}

.send-btn {
    padding: 0 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 80px;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== PROGRESS PANEL ===== */
.progress-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.level-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.xp-bar {
    height: 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 20px 0;
    position: relative;
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.xp-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
    max-width: 100%;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    min-width: 0;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    word-break: break-all;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    font-weight: 500;
    word-break: break-word;
}

/* ===== LEADERBOARD ===== */
.leaderboard {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    overflow-x: auto;
}

.leaderboard-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.leaderboard-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-surface);
    padding: 4px;
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.leaderboard-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.leaderboard-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    min-width: 800px;
}

.leaderboard-table th {
    text-align: left;
    padding: 16px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.leaderboard-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-table tr:not(.player-you):hover td {
    background: var(--bg-surface);
}

.player-you td {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(114, 9, 183, 0.1));
    border-left: 3px solid var(--primary-color);
}

.rank {
    font-weight: 700;
    width: 50px;
    text-align: center;
    position: relative;
}

.rank .trophy {
    display: inline-block;
}

.rank-1 .trophy {
    color: #ffd700;
    font-size: 20px;
    animation: trophyGlow 2s infinite;
}

.rank-2 .trophy {
    color: #c0c0c0;
    font-size: 18px;
}

.rank-3 .trophy {
    color: #cd7f32;
    font-size: 16px;
}

@keyframes trophyGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

/* ===== PROFILE PAGE ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    max-width: 100%;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

.profile-avatar-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    word-wrap: break-word;
}

.profile-group {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-group-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.profile-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.profile-settings {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
}

.settings-section {
    margin-bottom: 30px;
    max-width: 100%;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== RECENT ACHIEVEMENTS ===== */
.recent-achievements {
    padding: 15px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.no-achievements {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    max-width: 100%;
}

.no-achievements-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.no-achievements-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.no-achievements-subtext {
    font-size: 13px;
    color: var(--text-light);
}

.recent-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-width: 100%;
}

.recent-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
    min-width: 0;
}

.recent-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.recent-badge-icon {
    font-size: 24px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.recent-badge-info {
    flex: 1;
    min-width: 0;
}

.recent-badge-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-badge-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

/* ===== HISTORY ITEMS ===== */
.history-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
    max-width: 100%;
    word-break: break-word;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
    word-break: break-word;
}

.history-item-score {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-item-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
    word-wrap: break-word;
}

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.view-chat-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.view-chat-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* ===== RESULT MODAL ===== */
.result-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: center;
    padding: 0 20px;
    word-break: break-word;
}

.result-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
    text-align: center;
    padding: 0 20px;
    word-break: break-word;
}

.result-xp {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    text-align: center;
}

.result-details {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    max-width: 100%;
}

.ai-feedback-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    text-align: left;
    max-width: 100%;
}

.ai-feedback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-feedback-header i {
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.ai-feedback-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-feedback-content {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 0 20px 20px;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* ===== CHAT MODAL ===== */
.chat-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    width: 95%;
}

.chat-modal-header {
    padding: 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.chat-modal-info {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.info-item i {
    color: var(--primary-color);
    flex-shrink: 0;
}

.info-item.score {
    font-weight: 600;
    color: var(--primary-color);
}

.chat-modal-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 400px;
    max-height: 60vh;
    word-break: break-word;
}

.chat-modal-footer {
    padding: 16px 24px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.storage-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* ===== AVATAR MODAL ===== */
.avatar-preview-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    word-break: break-word;
}

.file-upload-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    text-align: center;
    max-width: 100%;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin: 0 auto 10px;
    white-space: nowrap;
}

.file-upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.file-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    word-break: break-word;
}

/* ===== FOOTER ===== */
.app-footer {
    background: var(--bg-card);
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    max-width: 100%;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.footer-link:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.footer-copyright {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    word-break: break-word;
}

/* ===== LEADERBOARD PLAYER INFO ===== */
.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.leaderboard-avatar-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.leaderboard-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ===== TRAINER INTERFACE ===== */
.trainer-search-section {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    max-width: 100%;
}

.trainer-search-input,
.trainer-date-input {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    flex: 1;
    min-width: 200px;
    max-width: 100%;
}

.trainer-search-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.vertical-group {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    max-width: 100%;
}

.vertical-header {
    padding: 16px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
    flex-wrap: wrap;
}

.vertical-header:hover {
    background: var(--bg-surface);
}

.vertical-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vertical-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.toggle-icon {
    transition: transform 0.3s;
    flex-shrink: 0;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

.vertical-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-width: 100%;
}

.vertical-content.expanded {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.student-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
    max-width: 100%;
}

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

.student-info {
    flex: 1;
    min-width: 200px;
    min-width: 0;
}

.student-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

.student-group {
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-word;
}

.student-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-badge {
    background: var(--bg-surface);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.trainer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.view-chat-btn-trainer,
.comment-btn {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.view-chat-btn-trainer {
    background: var(--bg-surface);
    color: var(--primary-color);
}

.view-chat-btn-trainer:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.comment-btn {
    background: var(--bg-surface);
    color: var(--warning-color);
}

.comment-btn:hover {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.trainer-comment {
    background: var(--bg-surface);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-color);
    word-break: break-word;
    max-width: 100%;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 8px;
}

.comment-text {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.scrollable-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-width: 100%;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .client-type-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .client-type-option.random {
        grid-column: span 3;
    }
    
    .app-content {
        max-width: calc(100% - 70px);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 12px 16px;
        height: auto;
        flex-direction: column;
        gap: 10px;
    }
    
    .header-left,
    .header-center,
    .header-right {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .header-center {
        order: 1;
    }
    
    .header-left {
        order: 2;
    }
    
    .header-right {
        order: 3;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .app-title {
        font-size: 18px;
        max-width: 100%;
    }
    
    .user-profile {
        justify-content: center;
        padding: 8px 12px;
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }
    
    .app-sidebar {
        width: 70px;
        padding: 16px 0;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .app-content {
        padding: 16px;
        max-width: calc(100% - 70px);
    }
    
    .welcome-section,
    .stat-card,
    .progress-panel,
    .leaderboard,
    .recent-achievements,
    .profile-settings {
        padding: 20px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .client-type-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .client-type-option.random {
        grid-column: span 2;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recent-achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .chat-modal-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .chat-modal-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .trainer-search-section {
        flex-direction: column;
    }
    
    .trainer-search-input,
    .trainer-date-input {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10px;
        border-radius: var(--radius-lg);
    }
    
    .auth-modal .modal-body {
        padding: 20px;
    }
    
    .client-type-selector {
        grid-template-columns: 1fr;
    }
    
    .client-type-option.random {
        grid-column: span 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .history-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .view-chat-btn {
        align-self: flex-end;
    }
    
    .app-sidebar {
        width: 60px;
    }
    
    .app-content {
        max-width: calc(100% - 60px);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animated {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

.slide-in-up {
    animation-name: slideInUp;
}

.pulse {
    animation: pulse 2s infinite;
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent
    );
    animation: shimmer 1.5s infinite;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-md);
}

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

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */
.text-overflow-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.word-break-all {
    word-break: break-all;
}

.word-break-word {
    word-break: break-word;
}

.max-width-100 {
    max-width: 100%;
}

.min-width-0 {
    min-width: 0;
}

.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-avatar-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.leaderboard-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.default-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}
/* Стили для вкладки достижений */
.achievements-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.achievements-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.filter-btn {
    padding: 8px 15px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.achievement-card.unlocked {
    border-color: var(--secondary-color);
    background: rgba(39, 174, 96, 0.05);
}

.achievement-card.locked {
    opacity: 0.7;
    filter: grayscale(0.5);
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

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

.achievement-title {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.achievement-category {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-color);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

.achievement-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.achievement-progress {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.achievement-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.status-unlocked {
    background: rgba(39, 174, 96, 0.2);
    color: var(--secondary-color);
}

.status-locked {
    background: rgba(108, 117, 125, 0.2);
    color: var(--text-muted);
}

/* Стили для недавних достижений в профиле */
.recent-achievements {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.recent-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-fast);
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

.recent-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

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

.recent-badge-info {
    flex: 1;
}

.recent-badge-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.recent-badge-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.no-achievements {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-achievements-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-achievements-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.no-achievements-subtext {
    font-size: 14px;
    opacity: 0.8;
}

.recent-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievements-section .stats-cards {
    margin-top: 20px;
    margin-bottom: 25px;
}

.achievements-section .stats-cards .stat-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.achievements-section .stats-cards .stat-card .value {
    font-size: 28px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: center;
    line-height: 1.2;
}

.achievements-section .stats-cards .stat-card .label {
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .achievements-section .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-section .stats-cards .stat-card {
        min-height: 100px;
    }
    
    .achievements-section .stats-cards .stat-card .value {
        font-size: 24px;
    }
    
    .achievements-section .stats-cards .stat-card .label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .achievements-section .stats-cards {
        grid-template-columns: 1fr;
    }
}

.compact-label {
    font-size: 12px !important;
    line-height: 1.2 !important;
    padding: 0 3px !important;
}

.shortened-label {
    font-size: 11px !important;
    line-height: 1.1 !important;
}
