:root {
    --primary-color: #6e48aa;
    --secondary-color: #9d50bb;
    --accent-color: #4776e6;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --text-color: #333;
    --text-light: #777;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    
    /* Dark mode variables */
    --bg-dark: #121212;
    --card-dark: #1e1e1e;
    --text-dark: #ffffff;
    --text-light-dark: #b0b0b0;
    --border-dark: #333;
}

/* Dark Mode - Elegant Chat Interface */
.dark-mode {
    --primary-color: #9d7aff;
    --secondary-color: #b58dff;
    --accent-color: #6ea8ff;
    --bg-dark: #121212;
    --card-dark: #1a1a1a;
    --text-color: #ffffff;
    --text-light: #a0a0a0;
    
    background-color: var(--bg-dark);
    color: var(--text-color);
}

/* ------------------------- */
/* CHAT MESSAGES - ANIMATED */
/* ------------------------- */
.dark-mode .chat-container {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.dark-mode .message {
    animation: messageSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.dark-mode .user-message {
    background: rgba(157, 122, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 18px 18px 4px 18px;
    padding: 15px 20px;
    margin-left: auto;
    max-width: 80%;
    box-shadow: var(--shadow);
    border: 1px solid rgba(157, 122, 255, 0.2);
    animation-delay: 0.1s;
}

.dark-mode .ai-message {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 18px 18px 18px 4px;
    padding: 15px 20px;
    max-width: 80%;
    box-shadow: var(--shadow);
    border: 1px solid rgba(110, 168, 255, 0.2);
}

.dark-mode .message-text {
    color: #ffffff !important;
    font-weight: 500;
    line-height: 1.7;
    font-size: 16px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.dark-mode .message-sender {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-mode .user-message .message-sender {
    color: var(--primary-color);
    justify-content: flex-end;
}

.dark-mode .ai-message .message-sender {
    color: var(--accent-color);
}

.dark-mode .message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Avatar Pulse Animation */
.dark-mode .avatar {
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 2px var(--primary-color);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(157, 122, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(157, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(157, 122, 255, 0); }
}

/* ------------------------- */
/* INPUT AREA - GLOW EFFECT */
/* ------------------------- */
.dark-mode .input-box {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(110, 168, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dark-mode .input-box:focus-within {
    box-shadow: 0 0 15px rgba(110, 168, 255, 0.3);
    border-color: rgba(110, 168, 255, 0.4);
    transform: translateY(-2px);
}

.dark-mode .message-input {
    color: #ffffff !important;
    background: transparent !important;
}

.dark-mode .send-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    box-shadow: 0 4px 15px rgba(110, 168, 255, 0.3);
}

.dark-mode .send-button:hover {
    transform: scale(1.1) rotate(5deg);
}

/* ------------------------- */
/* SIDEBAR - ELEGANT STYLE */
/* ------------------------- */
.dark-mode .sidebar {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode .chat-item {
    transition: var(--transition);
    border-radius: 10px;
}

.dark-mode .chat-item:hover {
    background: rgba(157, 122, 255, 0.1) !important;
    transform: translateX(5px);
}

.dark-mode .chat-item.active {
    background: rgba(157, 122, 255, 0.2) !important;
    box-shadow: inset 3px 0 0 var(--primary-color);
}

/* ------------------------- */
/* PROFILE - CLEAN STYLE */
/* ------------------------- */
.dark-mode .profile-text,
.dark-mode .my-profile {
    color: #ffffff !important;
    background: transparent !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dark-mode .user-info {
    padding: 15px;
    border-radius: 12px;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ------------------------- */
/* SPECIAL EFFECTS */
/* ------------------------- */
/* Floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.dark-mode .hakira-logo {
    animation: float 3s ease-in-out infinite;
}

/* Rainbow border on hover */
.dark-mode .avatar:hover {
    animation: rainbowBorder 2s linear infinite;
}

@keyframes rainbowBorder {
    0% { box-shadow: 0 0 0 3px #ff0000; }
    14% { box-shadow: 0 0 0 3px #ff7f00; }
    28% { box-shadow: 0 0 0 3px #ffff00; }
    42% { box-shadow: 0 0 0 3px #00ff00; }
    57% { box-shadow: 0 0 0 3px #0000ff; }
    71% { box-shadow: 0 0 0 3px #4b0082; }
    85% { box-shadow: 0 0 0 3px #9400d3; }
    100% { box-shadow: 0 0 0 3px #ff0000; }
}

/* ------------------------- */
/* TYPING INDICATOR */
/* ------------------------- */
.dark-mode .typing-indicator {
    background: rgba(30, 30, 30, 0.7);
    border-radius: 18px;
    padding: 12px 18px;
    width: fit-content;
    border: 1px solid rgba(110, 168, 255, 0.2);
}

.dark-mode .typing-dot {
    background: var(--accent-color);
    box-shadow: 0 0 8px rgba(110, 168, 255, 0.5);
}

/* ------------------------- */
/* SCROLLBAR STYLING */
/* ------------------------- */
.dark-mode ::-webkit-scrollbar {
    width: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* ------------------------- */
/* BUTTON GLOW EFFECT */
/* ------------------------- */
.dark-mode .new-chat-btn,
.dark-mode .save-profile {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.dark-mode .new-chat-btn::before,
.dark-mode .save-profile::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.2) 48%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 52%,
        rgba(255, 255, 255, 0) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 3s infinite linear;
    z-index: -1;
}

@keyframes shine {
    0% { left: -50%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

/* ------------------------- */
/* CODE BLOCKS */
/* ------------------------- */
.dark-mode .code-block {
    background: #1e1e1e !important;
    border: 1px solid rgba(110, 168, 255, 0.1);
    border-radius: 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.dark-mode .copy-code {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(110, 168, 255, 0.2);
}

.dark-mode .copy-code:hover {
    background: var(--accent-color);
}

/* ------------------------- */
/* RESPONSIVE ADJUSTMENTS */
/* ------------------------- */
@media (max-width: 768px) {
    .dark-mode .user-message,
    .dark-mode .ai-message {
        max-width: 90%;
    }
    
    .dark-mode .input-box {
        margin: 0 10px;
    }
}

/* ------------------------- */
/* LOADING ANIMATION */
/* ------------------------- */
.dark-mode .loading-spinner {
    border: 3px solid rgba(157, 122, 255, 0.2);
    border-top-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(157, 122, 255, 0.5);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.auth-container {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    animation: slideUp 0.5s 0.3s forwards;
    transition: var(--transition);
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.auth-tabs {
    display: flex;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.auth-tab {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.auth-content {
    padding: 30px;
    display: none;
    animation: fadeInContent 0.5s forwards;
}

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

.auth-content.active {
    display: block;
}

.auth-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background-color: white;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(110, 72, 170, 0.2);
    outline: none;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 72, 170, 0.4);
}

.auth-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.auth-button:hover::after {
    left: 100%;
}

.auth-error {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
    min-height: 20px;
}

/* App Container */
.app-container {
    display: none;
    height: 100vh;
    background-color: #f5f7fa;
    transition: var(--transition);
}

.app-container.active {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    height: 100vh;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    transform: translateX(0);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.sidebar.hidden {
    transform: translateX(-100%);
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-size: 20px;
}

.hakira-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.new-chat-btn {
    padding: 10px 15px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 72, 170, 0.3);
}

.new-chat-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.new-chat-btn:hover::after {
    left: 100%;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-day {
    font-size: 12px;
    color: var(--text-light);
    margin: 15px 0 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-item {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.chat-item:hover {
    background-color: #f0f2f5;
}

.chat-item.active {
    background-color: rgba(110, 72, 170, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.chat-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.delete-chat {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    transition: var(--transition);
    opacity: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-item:hover .delete-chat {
    opacity: 1;
}

.delete-chat:hover {
    color: var(--danger-color);
    background-color: rgba(244, 67, 54, 0.1);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #eee;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-name {
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-btn, .logout-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-btn {
    background-color: #f0f2f5;
    color: var(--text-color);
}

.profile-btn:hover {
    background-color: #e0e3e7;
}

.logout-btn {
    background-color: #ffebee;
    color: var(--danger-color);
}

.logout-btn:hover {
    background-color: #ffcdd2;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.toggle-sidebar {
    position: fixed;
    top: 15px;
    left: 15px;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.toggle-sidebar:hover {
    transform: scale(1.1);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-top: 70px;
}

.chat-messages {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    animation: messageIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes messageIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    transition: var(--transition);
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar:hover {
    transform: scale(1.1);
}

.ai-message .avatar {
    background: linear-gradient(to right, #4776e6, #8e54e9);
}

.message-content {
    flex: 1;
    max-width: calc(100% - 55px);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.message-sender {
    font-weight: 600;
    color: var(--primary-color);
}

.ai-message .message-sender {
    color: #4776e6;
}

.message-time {
    font-size: 12px;
    color: var(--text-light);
}

.message-text {
    line-height: 1.6;
    font-size: 15px;
    color: var(--text-color);
}

.message-text p {
    margin-bottom: 10px;
}

.message-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-text code {
    background-color: #f0f2f5;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.code-block {
    position: relative;
    margin: 15px 0;
    background-color: #282c34;
    border-radius: 8px;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
}

.code-block code {
    background-color: transparent !important;
    color: #abb2bf;
    font-family: 'Courier New', Courier, monospace;
    padding: 0;
    white-space: pre;
}

.copy-code {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.copy-code:hover {
    background: rgba(255, 255, 255, 0.2);
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input Container */
.input-container {
    padding: 20px;
    border-top: 1px solid #eee;
    background: white;
}

.input-box {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: flex-end;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.input-box:focus-within {
    box-shadow: 0 5px 15px rgba(110, 72, 170, 0.2);
}

.message-input {
    flex: 1;
    padding: 15px 60px 15px 20px;
    border: none;
    border-radius: 12px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    max-height: 200px;
    outline: none;
    background: transparent;
    transition: var(--transition);
}

.send-button {
    position: absolute;
    right: 15px;
    bottom: 15px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.send-button:hover {
    transform: scale(1.1);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Profile Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.profile-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: var(--transition);
    position: relative;
}

.profile-modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-modal:hover {
    color: var(--danger-color);
    background-color: rgba(244, 67, 54, 0.1);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

.avatar-options {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.avatar-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.avatar-option:hover {
    transform: scale(1.1);
}

.avatar-option.selected {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.1);
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    margin: 15px auto;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-btn {
    padding: 8px 15px;
    background: #f0f2f5;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    background: #e0e3e7;
}

.save-profile {
    width: 100%;
    padding: 12px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.save-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 72, 170, 0.4);
}

.save-profile::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.save-profile:hover::after {
    left: 100%;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        height: 100%;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }

    .chat-container {
        padding-top: 20px;
    }

    .message-content {
        max-width: calc(100% - 55px);
    }
}
