/**
 * /assets/css/style.css
 * ПОЛНАЯ ТАБЛИЦА СТИЛЕЙ: Среда решений
 * Версия: 2.2 (Full Functional + Fixed Profile Layout + Mobile Adaptive)
 */

/* 1. ПЕРЕМЕННЫЕ И ОСНОВА (Светлая тема) */
:root {
    /* Основная брендовая палитра */
    --brand-green: #10b981;
    --brand-blue: #1e3a8a;
    --brand-gradient: linear-gradient(135deg, #10b981 0%, #1e3a8a 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(30, 58, 138, 0.05) 100%);

    /* Цвета интерфейса */
    --primary: #10b981; 
    --primary-soft: rgba(16, 185, 129, 0.1);
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #475569;
    --text-dark: #0f172a;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    
    /* Доп. статусы */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Геометрия */
    --radius: 20px;
    --radius-sm: 12px;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-title: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. ТЕМНАЯ ТЕМА (Dark Mode) */
body.dark-mode {
    --bg: #020617;
    --card: #0f172a;
    --text: #94a3b8;
    --text-dark: #f8fafc;
    --text-muted: #64748b;
    --border: #1e293b;
    --primary-soft: rgba(16, 185, 129, 0.15);
}

/* 3. ОБЩИЕ СБРОСЫ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* 4. ДЕКОРАТИВНЫЕ ФОНОВЫЕ ПЯТНА (BLOBS) */
.ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    filter: blur(120px);
    border-radius: 50%;
    transition: opacity 0.5s;
}

.blob-1 {
    top: -150px;
    right: -100px;
    background: var(--brand-green);
    opacity: 0.07;
}

.blob-2 {
    bottom: -150px;
    left: -100px;
    background: var(--brand-blue);
    opacity: 0.1;
}

body.dark-mode .blob-1 { opacity: 0.1; }
body.dark-mode .blob-2 { opacity: 0.15; }

/* 5. НАВИГАЦИЯ (HEADER) */
nav {
    height: 80px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: background 0.3s, border 0.3s;
}

body.dark-mode nav {
    background: rgba(2, 6, 23, 0.7);
}

.navbar-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand span {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 6. КАРТОЧКИ (CARDS) */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 20px 40px -15px rgba(16, 185, 129, 0.08);
}

/* 7. КНОПКИ (BUTTONS) */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: var(--font-main);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    filter: brightness(1.1);
}

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

.btn-outline:hover {
    border-color: var(--brand-green);
    color: var(--brand-green);
    background: var(--primary-soft);
}

/* 8. ФОРМЫ (FORMS) */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus, 
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background: var(--card);
}

/* 9. ТИПОГРАФИКА */
h1, h2, h3, h4 {
    font-family: var(--font-title);
    color: var(--text-dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.text-primary {
    color: var(--brand-green);
}

/* 10. ТАБЛИЦЫ И АДАПТИВНАЯ ОБЕРТКА */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th {
    text-align: left;
    padding: 16px 20px;
    background: var(--primary-soft);
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

/* 11. СТАТУСЫ (BADGES) */
.badge {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
}

.badge-active, .badge-open { background: #dcfce7; color: #166534; }
.badge-closed { background: #f1f5f9; color: #64748b; }
.badge-pending { background: #fef9c3; color: #854d0e; }

/* 12. ИНТЕРФЕЙС ТИКЕТОВ (ЧАТ) */
.chat-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 500px; }

.messages-list { 
    padding: 30px; 
    background: var(--bg); 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 20px;
    max-height: 700px;
    overflow-y: auto;
}

.message-row { display: flex; width: 100%; }
.message-bubble { 
    max-width: 85%; 
    padding: 16px 20px; 
    border-radius: 20px; 
    background: var(--card); 
    border: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    position: relative;
}

.my-row { justify-content: flex-end; }
.my-row .message-bubble { 
    background: var(--brand-gradient); 
    color: #fff; 
    border: none; 
    border-bottom-right-radius: 4px; 
}
.my-row .message-info strong { color: rgba(255,255,255,0.9); }
.my-row .message-time { color: rgba(255,255,255,0.7); }
.my-row .message-content { color: #fff; }

.support-row { justify-content: flex-start; }
.support-row .message-bubble { 
    border-left: 4px solid var(--brand-green); 
    border-bottom-left-radius: 4px; 
}

.message-info { font-size: 0.8rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.message-time { color: var(--text-muted); font-size: 0.75rem; }
.message-content { line-height: 1.6; font-size: 0.95rem; word-break: break-word; }

.support-label { 
    background: var(--brand-green); 
    color: #fff; 
    padding: 2px 8px; 
    border-radius: 6px; 
    font-size: 0.65rem; 
    text-transform: uppercase; 
    font-weight: 800;
}

.chat-input-box { 
    padding: 20px; 
    background: var(--card); 
    border-top: 1px solid var(--border); 
    display: flex; 
    gap: 15px; 
    align-items: flex-end;
}
.chat-input-box textarea { 
    flex-grow: 1; 
    background: var(--bg); 
    border: 1px solid var(--border); 
    border-radius: 14px; 
    padding: 14px; 
    color: var(--text-dark); 
    font-family: inherit; 
    resize: none; 
    height: 54px;
    transition: 0.2s;
}
.chat-input-box textarea:focus { outline: none; border-color: var(--primary); height: 100px; }

/* 13. АНИМАЦИИ */
.fade-up {
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

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

/* 14. СПЕЦИАЛЬНЫЕ ЭЛЕМЕНТЫ (АДМИНКА И ПРОФИЛЬ) */
.avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--brand-gradient);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--font-title);
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    border: 1px solid transparent;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--brand-gradient-soft);
    border-color: var(--brand-green);
}

/* АДМИНКА: СКРИНШОТЫ */
.admin-screen-card { width: 90px; height: 120px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--border); background: #000; }
.admin-screen-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.screen-remove-x { 
    position: absolute; top: 5px; right: 5px; background: var(--error); color: #fff; 
    width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; font-size: 14px; font-weight: 900; cursor: pointer; border: 2px solid #fff;
}

/* АДМИНКА: СЕТКИ ФОРМ */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 20px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }

/* ICON PICKER */
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; margin-bottom: 20px; }
.icon-option { padding: 15px; border: 2px solid var(--border); border-radius: 16px; text-align: center; cursor: pointer; transition: 0.2s; background: var(--bg); }
.icon-option svg { color: var(--text-muted); transition: 0.2s; }
.icon-option:hover { border-color: var(--primary); background: var(--card); }
.icon-option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 4px var(--primary-soft); }
.icon-option.selected svg { color: var(--primary); transform: scale(1.1); }

/* УВЕДОМЛЕНИЯ */
.alert { padding: 15px; border-radius: 12px; margin-bottom: 20px; font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; }
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border-color: var(--success); }
.alert-error { background: rgba(239, 68, 68, 0.1); color: var(--error); border-color: var(--error); }
.alert-info { background: rgba(30, 58, 138, 0.1); color: var(--brand-blue); border-color: var(--brand-blue); }

/* 15. ПРОФИЛЬ (ИСПРАВЛЕННАЯ СЕТКА И ПОЗИЦИОНИРОВАНИЕ) */
.profile-header-card { 
    background: var(--card); 
    border-radius: var(--radius); 
    overflow: hidden; 
    border: 1px solid var(--border); 
    margin-bottom: 32px; 
}
.profile-cover { 
    height: 180px; 
    background: var(--brand-gradient); 
    opacity: 0.9; 
}
.profile-header-content { 
    display: flex; 
    padding: 0 40px 30px; 
    align-items: flex-start; 
    gap: 28px; 
    position: relative; 
}
.profile-avatar-wrapper { 
    margin-top: -65px; 
    position: relative; 
    flex-shrink: 0; 
    z-index: 2; 
}
.profile-main-avatar { 
    width: 140px; 
    height: 140px; 
    border-radius: 40px; 
    background: var(--card); 
    border: 6px solid var(--card); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 4rem; 
    font-family: var(--font-title); 
    font-weight: 800; 
    color: var(--primary); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}
.profile-user-info { 
    flex-grow: 1; 
    padding-top: 18px; 
}
.profile-actions { 
    padding-top: 22px; 
}
.profile-name { 
    font-size: 2.2rem; 
    margin-bottom: 4px; 
    color: var(--text-dark); 
    line-height: 1.2; 
}
.profile-role { 
    color: var(--primary); 
    font-weight: 700; 
    font-size: 1.05rem; 
    margin-bottom: 10px; 
}
.profile-meta { 
    display: flex; 
    gap: 20px; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    font-weight: 600; 
    flex-wrap: wrap; 
}
.profile-grid { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }

/* 16. АДАПТИВНОСТЬ (MOBILE) */
@media (max-width: 1024px) {
    .profile-grid, .project-grid-layout, .ticket-grid { grid-template-columns: 1fr; }
    .project-sidebar { order: -1; }
}

@media (max-width: 768px) {
    :root { --radius: 16px; }
    h1 { font-size: 2.2rem !important; }
    h2 { font-size: 1.8rem !important; }
    .nav-desktop-only { display: none !important; }
    .navbar-inner { height: 60px; }
    .nav-brand { font-size: 1.3rem; }
    .project-header-flex { flex-direction: column; text-align: center; }
    .project-icon-large { margin: 0 auto 20px; width: 100px; height: 100px; }
    .card { padding: 20px; }
    .form-grid-2, .form-grid-3, .form-grid-4, .category-grid, .project-grid, .faq-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    
    /* Мобильный профиль */
    .profile-header-content { flex-direction: column; align-items: center; text-align: center; padding: 0 20px 30px; }
    .profile-avatar-wrapper { margin-top: -70px; }
    .profile-user-info { padding-top: 0; }
    .profile-actions { padding-top: 0; width: 100%; }
    .profile-meta { justify-content: center; flex-wrap: wrap; gap: 10px; }
    .profile-main-avatar { width: 130px; height: 130px; font-size: 3.5rem; }
}

@media (max-width: 480px) {
    .nav-brand span { display: none; }
    .btn { width: 100%; text-align: center; }
    .hero-buttons { flex-direction: column; }
    .message-bubble { max-width: 95%; }
}

/* 17. СКРОЛЛБАР */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 18. ФИКСЫ */
main { flex: 1; }
.screenshots-viewer { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
.screen-wrapper { flex: 0 0 auto; width: 200px; height: 360px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); scroll-snap-align: start; }
.screen-wrapper img { width: 100%; height: 100%; object-fit: cover; }