/* public/assets/css/app.css */

/* =========================================================
   1. IMPORT FONTS
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* =========================================================
   2. GLOBAL VARIABLES (THEME - Indigo Style)
   ========================================================= */
:root {
    /* Основная палитра */
    --color-primary: #4F46E5;
    --color-primary-dark: #4338CA;
    --color-primary-light: #EEF2FF;
    
    --color-accent: #F59E0B;
    --color-accent-hover: #D97706;
    --color-danger: #EF4444;

    /* Текст */
    --color-text-main: #1F2937;
    --color-text-heading: #111827;
    --color-text-muted: #6B7280;

    /* Фон */
    --color-bg-body: #F9FAFB;
    --color-bg-white: #FFFFFF;
    --color-border: #E5E7EB;

    /* Размеры */
    --container-width: 1440px; 
    --header-height: 80px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Анимации */
    --transition: all 0.2s ease-in-out;
}

@media (min-width: 1600px) {
    :root {
        --container-width: 1600px;
    }
}

/* =========================================================
   3. RESET & BASE
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; }

/* =========================================================
   4. LAYOUT & GRID
   ========================================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.grid {
    display: grid;
    gap: 24px;
}

/* =========================================================
   5. TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4 {
    font-weight: 800;
    color: var(--color-text-heading);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* =========================================================
   6. LOGO & HEADER BASE
   ========================================================= */
.main-header {
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 24px;
}

/* Зона 1: Логотип (ОБНОВЛЕНО ПОД КАРТИНКУ) */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Стили для картинки логотипа */
.brand-logo img {
    width: 40px;  /* Размер как на макете */
    height: 40px;
    border-radius: 8px; /* Скругление углов картинки */
    object-fit: contain;
}

.brand-logo:hover { opacity: 0.9; }

/* Зона 2: Поиск или Пробел (Центр) */
.header-center-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-spacer {
    flex: 1;
}

/* Зона 3: Правые элементы (Аватар, Гамбургер) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    height: 100%;
}

/* =========================================================
   6.1 HEADER NOTIFICATIONS (Unread badge)
   ========================================================= */
.header-notifications {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-main);
    transition: var(--transition);
}

.header-notifications:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.header-notifications i {
    font-size: 1.4rem;
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    line-height: 20px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

/* =========================================================
   7. BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-size: 0.95rem;
    line-height: 1;
}

.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

.btn-primary {
    background-color: #fff;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-accent { background-color: var(--color-accent); color: #fff; }
.btn-accent:hover { background-color: var(--color-accent-hover); }

.btn-outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-main);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: #fff;
}

/* =========================================================
   8. CARDS & FORMS
   ========================================================= */
.card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-heading);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    color: var(--color-text-main);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* =========================================================
   9. HEADER USER DROPDOWN (Desktop)
   ========================================================= */
.header-user-dropdown { position: relative; height: 100%; display: flex; align-items: center; }

.header-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
    border-radius: 30px;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--color-text-main);
    cursor: pointer;
}
.header-user-link:hover { background: #F3F4F6; }

.header-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #E0E7FF;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-username {
    font-weight: 700;
    font-size: 0.9rem;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.dropdown-menu {
    position: absolute; top: calc(100% - 10px); right: 0;
    width: 240px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 14px;
}
.header-user-dropdown:hover .dropdown-menu,
.header-user-dropdown.is-active .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--color-text-main);
    font-size: 0.95rem;
    font-weight: 500;
}
.dropdown-menu a:hover { background: #F3F4F6; color: var(--color-primary); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: 6px 0; }


/* =========================================================
   10. OFFCANVAS MENU (Hamburger)
   ========================================================= */

/* Burger Button */
.burger-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: background 0.2s;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-main);
}
.burger-btn:hover {
    background: #F3F4F6 !important;
    color: var(--color-primary) !important;
}
.burger-btn i { font-size: 1.8rem; }

/* Overlay */
.offcanvas-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 4999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
}
.offcanvas-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Menu Panel */
.offcanvas-menu {
    position: fixed;
    top: 0; right: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 5000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}
.offcanvas-menu.active {
    transform: translateX(0);
}

/* Header inside Menu */
.offcanvas-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--color-border);
}
.offcanvas-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text-heading);
}
.offcanvas-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}
.offcanvas-close:hover { color: var(--color-danger); }

/* Navigation Links */
.offcanvas-nav {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.offcanvas-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-main);
    border-radius: 12px;
    transition: all 0.2s;
}
.offcanvas-link i {
    font-size: 1.4rem;
    color: var(--color-text-muted);
}
.offcanvas-link:hover {
    background: #F3F4F6;
    color: var(--color-primary);
}
.offcanvas-link:hover i {
    color: var(--color-primary);
}

.offcanvas-divider {
    height: 1px;
    background: var(--color-border);
    margin: 16px 0;
}

/* Auth Buttons in Mobile Menu */
.offcanvas-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* =========================================================
   11. RESPONSIVE ADJUSTMENTS
   ========================================================= */

@media (max-width: 992px) {
    .header-username { display: none; }
}

@media (max-width: 576px) {
    .container { padding: 0 16px; }
    
    :root { --header-height: 70px; }
    
    /* Логотип чуть меньше на мобильных */
    .brand-logo { font-size: 1.4rem; }
    .brand-logo img { width: 32px; height: 32px; }
    
    .burger-btn i { font-size: 1.6rem !important; }
}
  