:root {
    --primary: #6c5ce7;
    --primary-hover: #a29bfe;
    --bg: #0f1015;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text: #f5f6fa;
    --text-muted: #a4b0be;
    --danger: #ff4757;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Subtle background gradient */
    background: radial-gradient(circle at 15% 50%, rgba(108, 92, 231, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(255, 71, 87, 0.1), transparent 25%),
                var(--bg);
}

a {
    color: var(--primary-hover);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #fff;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Auth Panels */
.login-panel {
    width: 100%;
    max-width: 400px;
    margin: auto;
    margin-top: 15vh;
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-panel h1 {
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-panel p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

/* Forms */
input[type="text"], input[type="password"] {
    width: 100%;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-danger {
    background: var(--danger);
}
.btn-danger:hover {
    background: #ff6b81;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn-small {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.link-small {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Main App Layout */
#main-interface {
    display: flex;
    flex-direction: column;
    height: 100vh;
    animation: fadeIn 0.8s ease;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 16, 21, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: var(--primary);
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    gap: 1rem;
}

/* Video Player Area */
.video-container {
    flex: 3;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

#video-player {
    width: 100%;
    max-height: 100%;
    outline: none;
    background: #000;
}

.center-panel {
    text-align: center;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-top: 1.5rem;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat & Sidebar */
.chat-sidebar {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.users-list {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.users-list h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

#online-users {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#online-users li {
    background: rgba(255,255,255,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
}
#online-users li.admin-tag {
    background: var(--danger);
    color: white;
}

.chat-container {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar.fullscreen-overlay {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 350px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    z-index: 1000;
    border: none;
    border-radius: 0;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chat-msg {
    background: rgba(255,255,255,0.05);
    padding: 0.8rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: slideUp 0.3s ease;
}

.chat-msg .author {
    font-weight: 600;
    color: var(--primary-hover);
    margin-right: 0.5rem;
}

.chat-msg .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    float: right;
}

.chat-input-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.2);
}

.chat-input-form input {
    flex: 1;
    margin-bottom: 0;
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.chat-input-form button {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0 1.2rem;
    border-radius: 0 8px 8px 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}
.chat-input-form button:hover {
    background: var(--primary-hover);
}

.emoji-btn {
    background: rgba(0,0,0,0.2) !important;
    border-radius: 8px 0 0 8px !important;
    border-right: 1px solid var(--border-glass) !important;
    padding: 0 0.8rem !important;
}
.emoji-btn:hover {
    background: rgba(255,255,255,0.1) !important;
}
.chat-input-form input {
    border-radius: 0 !important;
}

#emoji-picker {
    position: absolute;
    bottom: 70px;
    right: 20px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    z-index: 50;
}

#emoji-picker .emoji {
    font-size: 1.5rem;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}
#emoji-picker .emoji:hover {
    transform: scale(1.2);
}

/* Modals */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    color: var(--text-muted);
    transition: color 0.3s;
}
.close:hover {
    color: white;
}

.styled-list {
    list-style: none;
    margin-top: 1.5rem;
}

.styled-list li {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.styled-list li:last-child {
    border-bottom: none;
}

.styled-list button {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}
.styled-list button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    .chat-sidebar {
        min-width: 100%;
        max-width: 100%;
        flex: 1;
    }
    .video-container {
        min-height: 40vh;
    }
}
