/*
 * Path: /public/css/app.css
 * File: app.css (Updated with correct modal scrolling)
 */
/* ==========================================================================
   MODERN DASHBOARD CSS v2.0 (with Dynamic Profile Blocks)
   Professional Design for Komod.net
   Date: 2025
   ========================================================================== */

/* ==========================================================================
   0. CSS RESET, FONTS & BRAND COLORS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #5D3EFF;
    --primary-color-dark: #4b2fde;
    --primary-color-light: rgba(93, 62, 255, 0.08);
    --success-color: #22c55e;
    --success-color-light: #f0fdf4;
    --error-color: #ef4444;
    --error-color-light: #fef2f2;
    --warning-color: #f59e0b;
    --warning-color-light: #fffbeb;

    --text-dark: #1e293b;
    --text-regular: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;
    --background-light: #f8fafc;
    --background-gradient: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    
    /* Spacing & Radius from new uploader */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-y: scroll; /* Prevents layout shift */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-regular);
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg, video, canvas { max-width: 100%; height: auto; }

/* ==========================================================================
   1. LAYOUT & CONTAINER SYSTEM
   ========================================================================== */
.container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 32px; }
.site-main { flex: 1; padding: 0; }
.dashboard-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; }

/* ==========================================================================
   2. HEADER STYLES
   ========================================================================== */
.site-header { background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid var(--border-color-light); padding: 20px 0; backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 1000; }
.header-row { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 1.8rem; font-weight: 700; color: var(--text-dark); text-decoration: none; display: flex; align-items: center; gap: 12px; transition: opacity 0.3s ease; }
.brand:hover { opacity: 0.8; text-decoration: none; }
.brand__logo { height: 36px; width: auto; }

/* ==========================================================================
   3. SIDEBAR NAVIGATION
   ========================================================================== */
.dashboard-sidebar { background: rgba(255, 255, 255, 0.98); padding: 40px 0; border-right: 1px solid var(--border-color-light); position: sticky; top: 81px; height: calc(100vh - 81px); overflow-y: auto; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; padding: 0 24px; }
.sidebar-link { color: var(--text-light); text-decoration: none; padding: 14px 20px; border-radius: 10px; font-weight: 500; transition: all 0.2s ease-in-out; display: flex; align-items: center; gap: 14px; border: 1px solid transparent; }
.sidebar-link .icon { font-size: 1.2rem; line-height: 1; width: 1.2em; text-align: center; }
.sidebar-link:hover { color: var(--text-dark); background-color: var(--background-light); text-decoration: none; }
.sidebar-link.active { color: var(--primary-color); background-color: var(--primary-color-light); font-weight: 600; }

/* ==========================================================================
   4. MAIN CONTENT & CARD
   ========================================================================== */
.dashboard-content { background: #ffffff; padding: 48px; border-left: 1px solid var(--border-color-light); }
.card { background: #ffffff; border: 1px solid var(--border-color); border-radius: 16px; padding: 40px; margin-bottom: 32px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03); animation: fadeIn 0.5s ease-out forwards; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05); border-color: var(--border-color); }

/* ==========================================================================
   5. FORM STYLES
   ========================================================================== */
.form-group { margin-bottom: 24px; }
.form-label, .label { display: block; font-weight: 500; color: var(--text-light); margin-bottom: 8px; }
.form-control, .text-input, input[type="text"], input[type="email"], input[type="password"], textarea, select { width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: 10px; font-family: inherit; font-size: 1rem; color: var(--text-regular); transition: border-color 0.2s ease, box-shadow 0.2s ease; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: #fff; }
select.form-control { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.75rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.5rem; }
.form-control:focus, .text-input:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(93, 62, 255, 0.1); }
.form-error-text { color: #be123c; font-size: 0.9rem; margin-top: 6px; }
.helper-text { font-size: 0.875rem; color: var(--text-light); margin-top: 0.5rem; }

/* ==========================================================================
   6. TYPOGRAPHY, BUTTONS & UTILITIES
   ========================================================================== */
h1, h2, h3, h4 { margin-bottom: 24px; line-height: 1.3; font-weight: 600; color: var(--text-dark); }
h1 { font-size: 2.5rem; margin-bottom: 16px; font-weight: 700; letter-spacing: -0.02em; }
p { margin-bottom: 20px; color: var(--text-light); line-height: 1.7; }
.lead { font-size: 1.0rem; color: var(--text-light); font-weight: 400; line-height: 1.6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; text-decoration: none; border-radius: 10px; font-weight: 600; border: none; cursor: pointer; transition: all 0.3s ease; font-size: 1rem; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn--primary { background: var(--primary-color); color: white; box-shadow: 0 4px 12px rgba(93, 62, 255, 0.2); }
.btn--primary:hover:not(:disabled) { background: var(--primary-color-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(93, 62, 255, 0.25); text-decoration: none; color: white; }
.btn--outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-light); background: white; }
.btn--outline:hover:not(:disabled) { background: var(--background-light); border-color: #d1d5db; color: var(--text-regular); }
.btn-secondary { background: white; color: var(--text-regular); border: 1px solid var(--border-color); }
.btn-secondary:hover:not(:disabled) { background: var(--background-light); border-color: #cbd5e1; }
.btn--block { width: 100%; }
.action-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.clean-separator { height: 1px; background: var(--border-color-light); margin: 32px 0; border: none; }
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-muted { color: #94a3b8; font-size: 0.9rem; letter-spacing: 0.02em; font-weight: 500; }

/* ==========================================================================
   7. FOOTER & ACCESSIBILITY
   ========================================================================== */
.site-footer { background: #e7e7e7; color: #cbd5e1; padding: 30px 0; text-align: center; font-size: 0.9rem; margin-top: auto; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 3px; border-radius: 4px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.shake { animation: shake 0.5s ease-in-out; }

/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
  .container { padding: 0 24px; }
  .dashboard-layout { grid-template-columns: 260px 1fr; }
  .dashboard-content { padding: 32px; }
}
@media (max-width: 992px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border-color-light); padding: 12px 0; }
  .sidebar-nav { flex-direction: row; justify-content: flex-start; overflow-x: auto; padding: 0 16px; gap: 12px; }
  .sidebar-link { white-space: nowrap; flex-shrink: 0; padding: 10px 20px; }
  .dashboard-content { border-left: none; padding: 32px 16px; }
}
@media (max-width: 768px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .card { border: 0px solid var(--border-color); }
  .uploader-card-body { padding: var(--space-0); }
  .header-row { flex-wrap: wrap; gap: 16px; }
  .brand span { display: none; }
  .header-row .site-nav { margin-left: auto; }
  h1, h2 { font-size: 1.2rem; }  
  .card { padding: 0; }
  .action-buttons { flex-direction: column; }
  .btn { width: 100%; }
  .upload-zone { padding: var(--space-4) var(--space-6); }
}

/* ==========================================================================
   9. MODERN HEADER & SLIDEOUT NAVIGATION (v1.1)
   ========================================================================== */
.site-header-actions { display: flex; align-items: center; gap: 16px; }
.header-user-profile { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-regular); font-weight: 600; padding: 6px 12px; border-radius: 99px; transition: background-color 0.2s ease; }
.header-user-profile:hover { background-color: var(--background-light); color: var(--text-dark); }
.header-user-profile__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background-color: var(--border-color); }
.hamburger-btn { display: flex; flex-direction: column; justify-content: space-around; width: 28px; height: 24px; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 2001; }
.hamburger-btn .line { width: 100%; height: 3px; background-color: var(--text-dark); border-radius: 10px; transition: all 0.3s ease-in-out; }
.hamburger-btn.is-active .line1 { transform: rotate(45deg) translate(6px, 6px); }
.hamburger-btn.is-active .line2 { opacity: 0; }
.hamburger-btn.is-active .line3 { transform: rotate(-45deg) translate(6px, -6px); }
.slideout-nav-panel { position: fixed; top: 0; right: 0; width: 320px; max-width: 90%; height: 100%; background: #fff; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1); z-index: 2000; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); display: flex; flex-direction: column; padding: 32px; }
body.nav-is-open .slideout-nav-panel { transform: translateX(0); }
.nav-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: 1999; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
body.nav-is-open .nav-overlay { opacity: 1; visibility: visible; }
body.nav-is-open { overflow: hidden; }
body.nav-is-open .site-header, body.nav-is-open .site-main, body.nav-is-open .site-footer { filter: blur(5px); transition: filter 0.4s ease; pointer-events: none; }
.slideout-nav { display: flex; flex-direction: column; gap: 16px; flex-grow: 1; }
.slideout-nav__link { text-decoration: none; color: var(--text-regular); font-size: 1.2rem; font-weight: 600; padding: 12px 0; transition: color 0.2s ease; display: flex; align-items: center; gap: 12px; }
.slideout-nav__link:hover { color: var(--primary-color); }
.slideout-nav__link .icon { font-size: 1em; width: 1.2em; text-align: center; }
.slideout-nav__divider { height: 1px; background: var(--border-color-light); margin: 24px 0; }
.slideout-nav__actions { display: flex; flex-direction: column; gap: 16px; }
.slideout-nav__actions .btn { width: 100%; padding: 14px 24px; font-size: 1.05rem; }
.slideout-nav__lang-switcher { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: auto; padding-top: 24px; }
.slideout-nav__lang-switcher a { text-decoration: none; color: var(--text-light); font-weight: 600; padding: 8px 12px; border-radius: 8px; transition: all 0.2s ease; }
.slideout-nav__lang-switcher a.active, .slideout-nav__lang-switcher a:hover { background: var(--primary-color-light); color: var(--primary-color); }
@media (max-width: 767px) {
  .site-header-actions .btn--primary { display: none; }
  .header-user-profile span { display: none; }
}

/* ==========================================================================
   10. COMPONENTS (Alerts, etc.)
   ========================================================================== */
.alert { padding: 1rem; margin-bottom: 24px; border-radius: 10px; font-weight: 500; }
.alert--success { color: #166534; background-color: #f0fdf4; border: 1px solid #bbf7d0; }
.alert--danger { color: #be123c; background-color: #fff1f2; border: 1px solid #fecaca; }

/* ==========================================================================
   11. PUBLIC PROFILE PAGE STYLES (v2.0 - ИСПРАВЛЕННЫЙ БЛОК)
   ========================================================================== */
.profile-grid { display: grid; grid-template-columns: 1fr 320px; grid-template-areas: "header header" "content sidebar"; gap: 32px; margin: 2rem 0; }
.profile-card { background: #fff; border: 1px solid var(--border-color); border-radius: 16px; padding: 32px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03); }
.profile-content { grid-area: content; }
.profile-content h2, .profile-sidebar h3 { font-size: 1.75rem; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color-light); }
.profile-sidebar { grid-area: sidebar; }
.profile-sidebar h3 { font-size: 1.25rem; margin-bottom: 16px; }
.profile-content__bio--columns { column-count: 2; column-gap: 32px; }
.profile-content__bio--columns p { margin-top: 0; }
.sidebar-widget { margin-bottom: 32px; }

/* --- <<< НОВЫЙ СТИЛЬ ДЛЯ ОТСТУПОВ >>> --- */
.profile-content > .profile-card {
    margin-bottom: 32px;
}
.profile-content > .profile-card:last-child {
    margin-bottom: 0;
}


/* --- Новая шапка профиля v2 --- */
.profile-header-v2 {
    grid-area: header;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 32px;
    align-items: center;
}
.profile-header-v2__avatar-column {
    flex-shrink: 0;
    position: relative;
}
.profile-header-v2__avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: cover;
    transition: transform 0.3s ease;
}
.profile-header-v2__avatar-link {
    display: block;
    position: relative;
    width: 140px;
    height: 140px;
    z-index: 1;
}
.profile-header-v2__avatar-link:hover .profile-header-v2__avatar {
    transform: scale(1.05);
}
.profile-header-v2__info-column {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.profile-header-v2__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 8px;
}
.profile-header-v2__name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.profile-header-v2__role {
    font-size: 1.0rem;
    color: var(--text-light);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-header-v2__meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 16px;
}
.profile-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.profile-rating__stars {
    color: #f59e0b;
}
.profile-rating__reviews a {
    color: var(--text-light);
    text-decoration: underline;
    text-decoration-style: dashed;
    transition: color 0.2s ease;
}
.profile-rating__reviews a:hover {
    color: var(--primary-color);
}
.profile-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f0fdf4;
    color: #16a34a;
    padding: 6px 0;
    border-radius: 99px;
    font-size: 1.0rem;
    font-weight: 600;
}
.profile-header-v2__sub-meta {
    display: flex;
    gap: 24px;
    font-size: 1.0rem;
    color: var(--text-light);
}
.profile-header-v2__sub-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.profile-header-v2__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* --- Индикатор Онлайн-статуса --- */
.online-status-indicator {
    position: static;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 50%;
    background-color: #ccc;
    flex-shrink: 0;
}
.online-status-indicator.is-online {
    background-color: var(--success-color);
}

/* --- Адаптивность для новой шапки (ИСПРАВЛЕННЫЙ БЛОК) --- */
@media (max-width: 992px) {
    .profile-grid { 
        grid-template-columns: 1fr;
        grid-template-areas: "header" "content" "sidebar"; 
    }
    .profile-header-v2 {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
        gap: 24px;
    }
    .profile-header-v2__info-column {
        flex-direction: column;
        width: 100%;
    }
    .profile-header-v2__title-row {
        justify-content: center;
    }
    .profile-header-v2__meta-row,
    .profile-header-v2__sub-meta {
        justify-content: flex-start;
    }
    .profile-header-v2__actions {
        width: 100%;
        flex-direction: column;
    }
    .profile-header-v2__actions .btn {
        width: 100%;
    }
}
@media (max-width: 768px) {
    .profile-content__bio--columns { column-count: 1; }
    .profile-card { padding: 14px; }
}

/* ==========================================================================
   12. DYNAMIC PROFILE BLOCKS
   ========================================================================== */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.portfolio-item { position: relative; display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 4 / 3; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05); transition: transform .3s ease, box-shadow .3s ease; cursor: pointer; }
.portfolio-item:hover { transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: filter .3s ease; }
.portfolio-item:hover img { filter: brightness(.8); }
.tags-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { background-color: var(--primary-color-light); color: var(--primary-color); padding: 6px 14px; border-radius: 20px; font-size: .9rem; font-weight: 600; }
.service-list { display: flex; flex-direction: column; gap: 16px; }
.service-list__item { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--border-color-light); }
.service-list__item:last-child { border-bottom: none; padding-bottom: 0; }
.service-list__name { color: var(--text-regular); font-weight: 500; padding-right: 16px; }
.service-list__price { color: var(--text-dark); font-weight: 600; white-space: nowrap; }

/* --- Portfolio Management (Admin View) --- */
.portfolio-management-list { display: flex; flex-direction: column; gap: 1rem; }
.portfolio-management-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--background-light); border-radius: 12px; }
.item-thumbnail { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; transition: transform .2s ease; cursor: zoom-in; }
.item-thumbnail:hover { transform: scale(1.1); }
.item-title { flex-grow: 1; font-weight: 500; }
.item-actions { display: flex; gap: .5rem; }

/* ==========================================================================
   13. CUSTOM LIGHTBOX STYLES
   ========================================================================== */
body.lightbox-is-open { overflow: hidden; }
.custom-lightbox { position: fixed; z-index: 9999; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, .85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.custom-lightbox.is-visible { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.custom-lightbox__close { position: absolute; top: 20px; right: 30px; background: none; border: none; color: #fff; font-size: 40px; font-weight: 700; cursor: pointer; transition: color .2s ease, transform .2s ease; z-index: 10001; line-height: 1; padding: 0; }
.custom-lightbox__close:hover { color: #cbd5e1; transform: scale(1.1); }
.custom-lightbox__content-wrapper { position: relative; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; animation: lightbox-fade-in .4s cubic-bezier(.25, 1, .5, 1); }
.custom-lightbox__image { display: block; max-width: 100%; max-height: calc(90vh - 40px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,.2), 0 8px 10px -6px rgba(0,0,0,.2); object-fit: contain; }
.custom-lightbox__caption { color: #e2e8f0; text-align: center; margin-top: 15px; font-size: 1rem; font-weight: 500; }
@keyframes lightbox-fade-in { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ==========================================================================
   14. ADVANCED UPLOADER STYLES
   ========================================================================== */
.uploader-card { background: var(--background-light); border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; }
.uploader-card-body { padding: var(--space-8); }
.uploader-card-footer { padding: var(--space-6) var(--space-8); background: #fff; border-top: 1px solid var(--border-color); }
.upload-zone { border: 2px dashed var(--border-color); border-radius: var(--radius-lg); padding: 3rem var(--space-8); text-align: center; background: #fff; transition: all 0.2s ease; cursor: pointer; position: relative; }
.upload-zone:hover { border-color: var(--primary-color); background: var(--primary-color-light); }
.upload-zone.drag-over { border-color: var(--primary-color); background: var(--primary-color-light); transform: scale(1.02); }
.upload-zone.has-file { border-color: var(--success-color); background: var(--success-color-light); }
.upload-icon { width: 64px; height: 64px; margin: 0 auto var(--space-4); background: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.upload-zone.has-file .upload-icon { background: var(--success-color); }
.upload-text { margin-bottom: var(--space-4); }
.upload-primary-text { font-size: 1.25rem; font-weight: 600; color: var(--text-dark); margin-bottom: var(--space-2); }
.upload-secondary-text { font-size: 1rem; color: var(--text-light); }
.browse-button { display: inline-flex; align-items: center; gap: var(--space-2); background: var(--primary-color); color: #fff; padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); font-weight: 500; text-decoration: none; transition: all 0.2s ease; }
.browse-button:hover { background: var(--primary-color-dark); transform: translateY(-1px); }
.file-input { display: none; }
.preview-section { margin-top: var(--space-8); display: none; }
.preview-section.visible { display: block; animation: fadeIn 0.3s ease-out; }
.preview-grid { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 640px) { .preview-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.preview-image { width: 140px; height: 140px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-color); }
.preview-image img { width: 100%; height: 100%; object-fit: cover; }
.file-details { display: flex; flex-direction: column; gap: var(--space-4); }
.file-meta { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.meta-item { display: flex; flex-direction: column; gap: var(--space-1); }
.meta-label { font-size: 0.75rem; color: var(--text-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: 0.875rem; font-weight: 600; color: var(--text-dark); word-break: break-all; }
.validation-status { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500; }
.status-success { background: var(--success-color-light); color: var(--success-color); }
.status-error { background: var(--error-color-light); color: var(--error-color); }
.status-warning { background: var(--warning-color-light); color: var(--warning-color); }
.actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.progress-container { margin-top: var(--space-4); }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-2); }
.progress-label { font-size: 0.875rem; font-weight: 500; color: var(--text-regular); }
.progress-value { font-size: 0.875rem; font-weight: 600; color: var(--primary-color-dark); }
.progress-bar { height: 6px; background: var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary-color); border-radius: var(--radius-md); transition: width 0.3s ease; width: 0%; }

/* ==========================================================================
   15. CUSTOM
   ========================================================================== */

@media (max-width: 768px) {
.uploader-card-body {padding: var(--space-0);} 
.dashboard-content {padding: 32px 0px;}
.portfolio-management-item {padding: 0rem;}
.profile-header-v2__meta-row {gap: 0px;}
.profile-rating {padding: 4px 0; margin-right: 14px;}
.profile-badge-verified {padding: 4px 0;}
.profile-header-v2__role {margin: 0 0 4px;}
.profile-header-v2__name  {margin-bottom: 24px;}
.profile-header-v2__meta-row {margin-bottom: 4px;}
}

/* ==========================================================================
   16. DIGITAL SOUL AVATAR AURA & LEGEND
   ========================================================================== */

.digital-soul-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.digital-soul-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 112%;
    height: 112%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    overflow: visible;
    z-index: 2;
}

.digital-soul-svg__ray {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    pointer-events: stroke;
}

@keyframes soul-vibrate {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.03); 
    }
}

.digital-soul-container.vibrating .digital-soul-svg {
    animation: soul-vibrate 0.4s ease-in-out;
}

.digital-soul-tooltip {
    position: absolute;
    background-color: var(--text-dark);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
    white-space: nowrap;
}

.digital-soul-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   17. DIGITAL SOUL LEGEND MODAL
   ========================================================================== */

.profile-header-v2__title-row .digital-soul-trigger {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.profile-header-v2__title-row .digital-soul-trigger:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    /* <<< ИСПРАВЛЕНО: Центрируем по вертикали >>> */
    align-items: center; 
    padding: 2rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s .3s;
    /* Убираем прокрутку с фона */
}

.modal.is-visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, .85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,.2), 0 8px 10px -6px rgba(0,0,0,.2);
    transform: scale(.95);
    transition: transform .3s cubic-bezier(.25, 1, .5, 1);
    margin: auto;
    
    /* <<< ИСПРАВЛЕНО: Добавляем прокрутку только к контенту >>> */
    max-height: 90vh; /* Ограничиваем высоту */
    overflow-y: auto; /* Добавляем прокрутку */
}


.modal.is-visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color .2s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

.digital-soul-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.digital-soul-legend li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.digital-soul-legend .legend-color {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--color);
    margin-top: 4px;
}

.digital-soul-legend strong {
    color: var(--text-dark);
}




/* ==========================================================================
   18. CHAT WIDGET STYLES
   ========================================================================== */

.chat-toggle-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1050; /* Выше чем overlay сайдбара, но ниже самого сайдбара */
}

.chat-toggle-button:hover {
    background-color: var(--primary-color-dark);
    transform: scale(1.1);
}

.chat-toggle-button .icon-opened { display: none; }
.chat-toggle-button.active .icon-closed { display: none; }
.chat-toggle-button.active .icon-opened { display: block; }
.chat-toggle-button.active { background-color: var(--text-light); } /* Цвет кнопки при открытом чате */


.chat-widget {
    position: fixed;
    bottom: calc(2rem + 60px + 1rem); /* Над кнопкой */
    right: 2rem;
    width: 350px;
    max-width: calc(100vw - 4rem);
    height: 450px;
    max-height: calc(100vh - 4rem - 60px - 1rem);
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1040;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.chat-widget.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chat-widget__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color-light);
    flex-shrink: 0;
}

.chat-widget__header #chat-recipient-name {
    font-weight: 600;
    color: var(--text-dark);
}

.chat-widget__header #chat-status-indicator {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    margin-left: auto; /* Двигаем статус влево от кнопки закрытия */
    margin-right: 0.5rem;
}

.chat-widget__header .status-online {
    background-color: var(--success-color-light);
    color: var(--success-color);
}
.chat-widget__header .status-offline {
    background-color: var(--border-color-light);
    color: var(--text-light);
}

.chat-widget__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.2s ease;
}
.chat-widget__close:hover {
    color: var(--text-dark);
}

.chat-widget__messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #fff; /* Фон области сообщений */
}

.chat-message {
    max-width: 80%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message .message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}
.chat-message .message-time {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-left: 0.5rem;
    font-weight: 400;
}
.chat-message .message-body {
    font-size: 0.9rem;
}


.chat-message.incoming {
    background-color: var(--background-light);
    border: 1px solid var(--border-color-light);
    align-self: flex-start;
    border-top-left-radius: 0; /* Уголок для входящих */
}
.chat-message.incoming .message-sender { /* Имя отправителя можно скрыть, если аватар рядом */
    /* display: none; */
}


.chat-message.outgoing {
    background-color: var(--primary-color-light);
    border: 1px solid rgba(93, 62, 255, 0.1);
    color: var(--text-regular);
    align-self: flex-end;
    border-top-right-radius: 0; /* Уголок для исходящих */
}
.chat-message.outgoing .message-sender {
     display: none; /* Свое имя не показываем */
}
.chat-message.outgoing .message-body {
    color: #333; /* Темнее текст для лучшей читаемости */
}


.chat-widget__input-area {
    display: flex;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color-light);
    background-color: var(--background-light);
    flex-shrink: 0;
}

#chat-message-input {
    flex-grow: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-right: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#chat-message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 62, 255, 0.1);
}

#chat-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}
#chat-send-button:hover {
    background-color: var(--primary-color-dark);
}
#chat-send-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .chat-toggle-button {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    .chat-widget {
        bottom: calc(1rem + 50px + 0.5rem); /* Відступ знизу над кнопкою (залишаємо) */
        right: 1rem;
        width: calc(100vw - 2rem);
        max-width: none;
        
        /* --- ВИПРАВЛЕННЯ --- */
        top: 1rem; /* <<< ДОДАНО: Встановлюємо верхню межу (1rem від верху екрану) */
        height: auto; /* <<< ЗМІНЕНО: Висота тепер автоматично заповнить простір */
        max-height: none; /* (залишаємо, щоб скасувати десктопне обмеження) */
}
}


