:root {
    --bg-image: url('https://img.itouxiang.com/m12/08/db/17c6404fcbde.jpg');
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-color: #333;
    --accent-color: #4a90e2;
}

body.dark-mode {
    --glass-bg: rgba(0, 0, 0, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #f0f0f0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    transition: background 0.3s;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
}

.auth-container {
    text-align: center;
}

input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
    outline: none;
    transition: 0.3s;
}

input:focus {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 5px var(--accent-color);
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

button:hover {
    opacity: 0.9;
}

.hidden {
    display: none;
}

/* Chat Interface */
.chat-container {
    display: flex;
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
}

.sidebar {
    width: 300px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.user-profile {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.search-box {
    padding: 10px;
}

.friend-list {
    flex: 1;
    overflow-y: auto;
}

.friend-item {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.friend-item:hover, .friend-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: var(--accent-color);
    color: white;
    border-bottom-right-radius: 2px;
}

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.6);
    color: #333;
    border-bottom-left-radius: 2px;
}

.input-area {
    padding: 15px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-area input {
    margin: 0;
}

.emoji-btn, .image-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    width: auto;
    padding: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chat-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .sidebar {
        width: 100%;
        position: absolute;
        height: 100%;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        z-index: 10;
        transition: transform 0.3s;
    }
    body.dark-mode .sidebar {
        background: rgba(0, 0, 0, 0.85);
    }
    
    .sidebar.hidden-mobile {
        transform: translateX(-100%);
    }
    
    .main-chat {
        width: 100%;
    }
    .sidebar:not(.hidden-mobile) ~ .main-chat {
        filter: blur(2px);
        opacity: 0.5;
        pointer-events: none;
    }
}

/* Admin Panel */
.admin-panel {
    width: 90vw;
    height: 90vh;
    overflow: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.user-table th, .user-table td {
    padding: 10px;
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
}
