/* Shared application styles */
:root {
    --primary-color: #5865f2;
    --secondary-color: rgba(17, 19, 24, 0.78);
    --accent-color: #8ea1ff;
    --background-color: 17,18,22;
    --front-color: #f8fbff;
    --panel-color: rgba(10, 12, 18, 0.44);
    --shadow-color: 88,101,242;
    --success-color: #3ba55c;
    --error-color: #ed4245;
    --warning-color: #faa81a;
    --gray-color: #d7ddeb;
    --my-chat-color: rgba(16, 20, 29, 0.56);
    --other-chat-color: rgba(14, 17, 25, 0.52);
    --system-chat-color: rgba(27, 22, 35, 0.58);
    --border-color: rgba(255, 255, 255, 0.16);
    --elevated-border: rgba(255, 255, 255, 0.20);
    --button-secondary-hover: rgba(24, 28, 38, 0.92);
    --button-panel-hover: rgba(20, 24, 34, 0.90);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --primary-color: #4f6bed;
    --secondary-color: rgba(233, 236, 245, 0.92);
    --accent-color: #6b7cff;
    --background-color: 236,239,244;
    --front-color: #1f2328;
    --panel-color: rgba(255, 255, 255, 0.72);
    --shadow-color: 79,107,237;
    --success-color: #2f9e44;
    --error-color: #d73a49;
    --warning-color: #b7791f;
    --gray-color: #5b6472;
    --my-chat-color: rgba(233, 239, 255, 0.82);
    --other-chat-color: rgba(255, 255, 255, 0.84);
    --system-chat-color: rgba(246, 239, 255, 0.84);
    --border-color: rgba(31, 35, 40, 0.10);
    --elevated-border: rgba(31, 35, 40, 0.14);
    --button-secondary-hover: rgba(220, 225, 236, 0.96);
    --button-panel-hover: rgba(228, 233, 243, 0.98);
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    color-scheme: dark;
}

body {
    background:
        radial-gradient(circle at top left, rgba(88, 101, 242, 0.16), transparent 28%),
        radial-gradient(circle at 82% 10%, rgba(142, 161, 255, 0.10), transparent 24%),
        linear-gradient(180deg, rgba(var(--background-color), 0.98) 0%, rgba(var(--background-color), 0.88) 100%);
    color: var(--front-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
}

header {
    background: rgba(17, 18, 22, 0.68);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.nav-menu {
    display: flex;
    gap: 12px;
    margin-left: 30px;
    flex: 1;
}

.nav-link {
    color: #dbdee1;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: white;
}

.nav-link.active {
    background: rgba(88, 101, 242, 0.18);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.35);
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

#user-info {
    font-weight: 600;
    color: #dbdee1;
}

.btn {
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.1;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.btn-primary,
.btn-accent {
    background: #5865f2;
    color: white;
}

.btn-primary:hover:not(:disabled),
.btn-accent:hover:not(:disabled) {
    background: #4752c4;
}

.btn-secondary {
    background: rgba(43, 45, 49, 0.76);
    color: #f2f3f5;
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover:not(:disabled),
.btn-gray:hover:not(:disabled) {
    background: var(--button-secondary-hover);
}

.btn-success {
    background: #248046;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #1f6f3d;
}

.btn-warning {
    background: #b58112;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #9a6f0e;
}

.btn-danger {
    background: #da373c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #bb2d32;
}

.btn-gray {
    background: #4e5058;
    color: white;
}

.btn:disabled {
    background: #3f4147;
    color: #8e9297;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.panel {
    background: rgba(30, 31, 34, 0.58);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28);
    margin-bottom: 22px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
}


.panel h2 {
    margin-bottom: 16px;
    color: var(--front-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    letter-spacing: 0.02em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #dbdee1;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background-color: rgba(17, 18, 22, 0.62);
    color: var(--front-color);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-control:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.form-control:focus {
    border-color: rgba(88, 101, 242, 0.78);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.16);
    background-color: rgba(20, 22, 27, 0.72);
}

.hidden {
    display: none !important;
}

.notification {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid transparent;
}

.notification.success {
    background-color: rgba(59, 165, 92, 0.12);
    border-color: rgba(59, 165, 92, 0.36);
    color: #78e08f;
}

.notification.error {
    background-color: rgba(237, 66, 69, 0.12);
    border-color: rgba(237, 66, 69, 0.36);
    color: #ff8b8d;
}

.notification.warning {
    background-color: rgba(250, 168, 26, 0.12);
    border-color: rgba(250, 168, 26, 0.36);
    color: #ffd37a;
}

.main-content {
    margin-top: 20px;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        margin-left: 0;
    }
    
    .auth-section {
        flex-wrap: wrap;
        justify-content: center;
    }
}
