/* To Talk Social - Основные стили Windows-стиль */
:root {
    /* Цветовая схема */
    --primary-color: #0078d4;
    --primary-dark: #106ebe;
    --primary-light: #1085e0;
    --secondary-color: #605e5c;
    --accent-color: #0078d4;
    
    /* Фоны */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-header: #0078d4;
    --bg-hover: #f3f2f1;
    --bg-active: #edebe9;
    
    /* Текст */
    --text-primary: #323130;
    --text-secondary: #605e5c;
    --text-light: #8a8886;
    --text-on-primary: #ffffff;
    
    /* Границы */
    --border-color: #d2d0ce;
    --border-light: #f3f2f1;
    --border-dark: #8a8886;
    
    /* Тени */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 28px rgba(0,0,0,0.3);
    
    /* Размеры */
    --sidebar-width: 280px;
    --header-height: 32px;
    --border-radius: 4px;
    --border-radius-lg: 8px;
}

/* СБРОС СТИЛЕЙ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 14px;
    overflow: hidden;
}

/* КОНТЕЙНЕР ОКОН - ПОВЕРХ ВСЕГО */
#windows-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

/* ОКНА WINDOWS-СТИЛЬ */
.window {
    position: absolute;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    min-width: 500px;
    min-height: 400px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
    pointer-events: all;
    resize: none;
}

.window.active {
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    border-color: var(--primary-color);
}

.window.maximized {
    border-radius: 0;
    border: none;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    max-width: 100vw;
    max-height: 100vh;
}

/* ЗАГОЛОВОК ОКНА WINDOWS-СТИЛЬ */
.window-header {
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
    padding: 6px 8px;
    border-bottom: 1px solid var(--primary-dark);
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    flex-shrink: 0;
    color: var(--text-on-primary);
    font-weight: 600;
    font-size: 13px;
    height: var(--header-height);
}

.window.active .window-header {
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
}

.window-header:hover {
    background: linear-gradient(to bottom, var(--primary-light), var(--primary-color));
}

.window-title {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    padding-left: 4px;
}

/* КНОПКИ УПРАВЛЕНИЯ WINDOWS-СТИЛЬ */
.window-controls {
    display: flex;
    gap: 1px;
}

.window-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: normal;
    transition: all 0.15s ease;
    background: transparent;
    color: var(--text-on-primary);
    margin: 0;
    padding: 0;
}

.window-btn:hover {
    background: rgba(255,255,255,0.2);
}

.window-btn:active {
    background: rgba(255,255,255,0.3);
}

.window-btn.close:hover {
    background: #e81123;
}

/* ОБЛАСТЬ СОДЕРЖИМОГО */
.window-content {
    padding: 0;
    flex: 1;
    overflow: auto;
    background: var(--bg-secondary);
}

/* РУЧКИ ИЗМЕНЕНИЯ РАЗМЕРА WINDOWS-СТИЛЬ */
.resize-handle {
    position: absolute;
    background: transparent;
    z-index: 10;
}

.resize-n {
    top: 0;
    left: 4px;
    right: 4px;
    height: 4px;
    cursor: n-resize;
}

.resize-e {
    top: 4px;
    right: 0;
    bottom: 4px;
    width: 4px;
    cursor: e-resize;
}

.resize-s {
    bottom: 0;
    left: 4px;
    right: 4px;
    height: 4px;
    cursor: s-resize;
}

.resize-w {
    top: 4px;
    left: 0;
    bottom: 4px;
    width: 4px;
    cursor: w-resize;
}

.resize-ne {
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    cursor: ne-resize;
}

.resize-nw {
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    cursor: nw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    cursor: se-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    width: 8px;
    height: 8px;
    cursor: sw-resize;
}

/* СТИЛИ ПЕРЕТАСКИВАНИЯ */
.window-dragging {
    opacity: 0.95;
    cursor: grabbing !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.window-resizing {
    user-select: none;
}

/* КАСКАДНОЕ РАСПОЛОЖЕНИЕ */
.window:nth-child(1) { left: 20px; top: 20px; }
.window:nth-child(2) { left: 50px; top: 50px; }
.window:nth-child(3) { left: 80px; top: 80px; }
.window:nth-child(4) { left: 110px; top: 110px; }
.window:nth-child(5) { left: 140px; top: 140px; }

/* ОСНОВНОЙ КОНТЕЙНЕР ПРИЛОЖЕНИЯ */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* БОКОВОЕ МЕНЮ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: var(--bg-header);
    color: var(--text-on-primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 700;
}

.user-welcome {
    font-size: 13px;
    opacity: 0.9;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    position: relative;
    margin-bottom: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    border-radius: 0;
}

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

.nav-link:active {
    background-color: var(--bg-active);
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.nav-text {
    font-weight: 500;
    flex: 1;
}

/* ПОДМЕНЮ */
.submenu {
    list-style: none;
    background: var(--bg-hover);
    display: none;
    border-left: 2px solid var(--primary-color);
    margin-left: 16px;
}

.nav-item:hover .submenu {
    display: block;
}

.sublink {
    padding: 8px 16px 8px 36px;
    font-size: 12px;
    color: var(--text-secondary);
    border-left: none;
}

.sublink:hover {
    background: var(--bg-active);
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-hover);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

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

.user-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.user-actions {
    display: flex;
    gap: 12px;
}

.user-settings, .user-logout {
    font-size: 11px;
    text-decoration: none;
    transition: color 0.2s;
}

.user-settings {
    color: var(--primary-color);
}

.user-settings:hover {
    color: var(--primary-dark);
}

.user-logout {
    color: #d13438;
}

.user-logout:hover {
    color: #b02a30;
}

/* ОБЛАСТЬ WELCOME СООБЩЕНИЯ */
.windows-area {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
    min-height: 100vh;
    z-index: 1;
}

.welcome-message {
    padding: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 1;
}

.welcome-content {
    max-width: 600px;
    text-align: center;
}

.welcome-content h1 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 2.5em;
    font-weight: 300;
}

.welcome-content p {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.quick-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 32px 0;
    flex-wrap: wrap;
}

.quick-stats .stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    min-width: 120px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.quick-stats .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2em;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
}

.welcome-tips {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    text-align: left;
    margin-top: 24px;
    border: 1px solid var(--border-light);
}

.welcome-tips h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.2em;
    font-weight: 600;
}

.welcome-tips ul {
    line-height: 1.6;
    color: var(--text-secondary);
    padding-left: 20px;
}

.welcome-tips li {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.welcome-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* КНОПКИ */
.btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    font-family: inherit;
}

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

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

.btn-primary {
    background: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
}

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

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

.btn-secondary:hover {
    background: #4c4a48;
    border-color: #4c4a48;
}

.btn-warning {
    background: #d83b01;
    color: var(--text-on-primary);
    border-color: #d83b01;
}

.btn-warning:hover {
    background: #b02a30;
    border-color: #b02a30;
}

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

/* СТИЛИ МОДУЛЕЙ */
.module-content {
    height: 100%;
    overflow-y: auto;
    padding: 16px;
}

/* СТИЛИ ПРОФИЛЯ */
.profile-module .profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 600;
    flex-shrink: 0;
}

.profile-info h2 {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1.5em;
    font-weight: 600;
}

.profile-info .username {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.user-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.user-status.admin {
    background: #e1f5fe;
    color: #01579b;
}

.user-status.user {
    background: #f3e5f5;
    color: #4a148c;
}

.profile-details {
    margin-bottom: 24px;
}

.details-section {
    margin-bottom: 20px;
}

.details-section h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.detail-item label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 120px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.stat-card {
    background: var(--bg-hover);
    padding: 16px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-light);
}

.stat-value {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1;
}

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

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        display: none;
    }
    
    .sidebar.active {
        display: flex;
    }
    
    .windows-area {
        min-height: calc(100vh - 200px);
    }
    
    .window {
        min-width: 95vw;
        min-height: 60vh;
        left: 2.5vw !important;
        top: 2.5vh !important;
    }
    
    .window.maximized {
        border-radius: 0;
    }
    
    .welcome-content {
        padding: 20px;
    }
    
    .welcome-content h1 {
        font-size: 2em;
    }
    
    .quick-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-stats .stat-card {
        width: 100%;
        max-width: 200px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
}

/* МОБИЛЬНОЕ МЕНЮ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    background: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    padding: 10px 14px;
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 10001;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* СКРОЛЛБАР */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 3px;
}

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

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

.window-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.window-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}