/* =============================================
   main.css - полные стили для Rezol Messenger
   ============================================= */

:root {
    --bg-primary: #151518;
    --bg-secondary: #1e1e24;
    --bg-tertiary: #282830;
    --text-primary: #ffffff;
    --text-secondary: #9e9eb0;
    --accent: #3549FF;
    --accent-hover: #4d5eff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --border: #2f2f3a;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* =============================================
   ОСНОВНЫЕ СТИЛИ
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a, a:link, a:visited, a:hover, a:active, a:focus {
    text-decoration: none !important;
    outline: none !important;
    color: inherit;
}

a:focus, button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Убираем подчёркивание у всех элементов где оно может появиться */
.tab, .nav-item, .btn, .icon-btn, .friend-card a, .request-card a {
    text-decoration: none !important;
}

body {
    background: var(--bg-primary);
    background-image: 
        repeating-linear-gradient(90deg, 
            rgba(53, 73, 255, 0.05) 0px, 
            rgba(53, 73, 255, 0.05) 1px, 
            transparent 1px, 
            transparent 20px),
        repeating-linear-gradient(180deg, 
            rgba(53, 73, 255, 0.05) 0px, 
            rgba(53, 73, 255, 0.05) 1px, 
            transparent 1px, 
            transparent 20px);
    color: var(--text-primary);
    font-family: 'Inter Tight', sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* =============================================
   ТИПОГРАФИКА
   ============================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5em;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    margin-bottom: 1em;
}

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

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

/* =============================================
   КНОПКИ
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: 'Unbounded', sans-serif;
    letter-spacing: 0.3px;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(53, 73, 255, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(53, 73, 255, 0.4);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--accent);
    background: rgba(53, 73, 255, 0.2);
    color: white;
}

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

.btn-success:hover {
    background: #34ce57;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #e34754;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: black;
}

.btn-warning:hover {
    background: #ffcd39;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =============================================
   ПОЛЯ ВВОДА
   ============================================= */

.input-group {
    margin-bottom: 20px;
    width: 100%;
}

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

.input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(53, 73, 255, 0.2);
}

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

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

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

/* =============================================
   БЕЙДЖИКИ
   ============================================= */

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    margin-left: 4px;
    transition: all 0.2s;
}

.role-badge:hover {
    transform: scale(1.1) rotate(5deg);
}

.role-badge.admin {
    background: #ff3b30;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.role-badge.moderator {
    background: #ff9500;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

.role-badge.verified {
    background: #3549FF;
    color: white;
    box-shadow: 0 2px 8px rgba(53, 73, 255, 0.3);
}

.role-badge.vip {
    background: #ffd700;
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* =============================================
   АВАТАРКИ
   ============================================= */

.avatar {
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(53, 73, 255, 0.3);
    flex-shrink: 0;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.avatar-md {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.avatar-lg {
    width: 100px;
    height: 100px;
    font-size: 40px;
}

.avatar-xl {
    width: 120px;
    height: 120px;
    font-size: 48px;
}

/* =============================================
   КАРТОЧКИ
   ============================================= */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* =============================================
   НАВИГАЦИЯ
   ============================================= */

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: white;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item i {
    width: 20px;
    font-size: 16px;
}

/* =============================================
   СООБЩЕНИЯ
   ============================================= */

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    max-width: 70%;
}

.message.my-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(53, 73, 255, 0.3);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-name {
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-time {
    color: var(--text-secondary);
    font-size: 11px;
}

.message-bubble {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--border);
    word-break: break-word;
}

.my-message .message-bubble {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.message-status {
    color: var(--text-secondary);
    font-size: 11px;
    margin-left: 4px;
}

.my-message .message-status {
    color: rgba(255, 255, 255, 0.7);
}

/* Файловые сообщения */
.file-attachment {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.file-attachment:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.my-message .file-attachment {
    background: var(--accent);
    border-color: var(--accent-hover);
}

.file-attachment i {
    font-size: 24px;
    color: var(--accent);
}

.my-message .file-attachment i {
    color: white;
}

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

.file-name {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-secondary);
    font-size: 11px;
}

.my-message .file-size {
    color: rgba(255, 255, 255, 0.7);
}

/* =============================================
   ПОИСК
   ============================================= */

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
}

.search-box i {
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* =============================================
   ТАБЫ
   ============================================= */

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

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-weight: 500;
}

.tab:hover {
    background: rgba(53, 73, 255, 0.2);
    color: white;
}

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

/* =============================================
   ФОРМЫ ВХОДА И РЕГИСТРАЦИИ - ИСПРАВЛЕНО
   ============================================= */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 380px; /* Уменьшил максимальную ширину */
    margin: 0 auto;
    box-shadow: var(--shadow);
    box-sizing: border-box;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Unbounded', sans-serif;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.auth-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.auth-card .input-group {
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.auth-card .input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.auth-card .input {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.auth-card .input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(53, 73, 255, 0.2);
}

.auth-card .input::placeholder {
    color: var(--text-secondary);
}

.auth-card .btn {
    width: 100%;
    padding: 12px 24px;
    box-sizing: border-box;
    margin-top: 10px;
}

.auth-card .error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #ff6b6b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.auth-card .error-message i {
    color: #dc3545;
}

.auth-card .success-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #28a745;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.auth-card .success-message i {
    color: #28a745;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Индикатор сложности пароля */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

.strength-weak { 
    background: #dc3545; 
}

.strength-medium { 
    background: #ffc107; 
}

.strength-strong { 
    background: #28a745; 
}

.requirements {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.requirements i {
    color: var(--accent);
    font-size: 10px;
}

.forgot-link {
    text-align: right;
    margin-top: 8px;
}

.forgot-link a {
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

/* =============================================
   СКРОЛЛБАР
   ============================================= */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

/* =============================================
   АНИМАЦИИ
   ============================================= */

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

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

/* =============================================
   УТИЛИТЫ
   ============================================= */

.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-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-accent { background: var(--accent); }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

/* =============================================
   АДАПТИВНОСТЬ
   ============================================= */

@media (max-width: 768px) {
    h1 { font-size: 28px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }
    
    .container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .message {
        max-width: 85%;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 15px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .avatar-lg {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}