@import url('https://fonts.googleapis.com/css2?family=Ruslan+Display&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'Helvetica Neue', sans-serif;
}
body {
    background: #111111;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
a {
    color: #d3c500;
}
.chat-container {
    background: rgba(30, 40, 50, 0.85);
    width: 95vw;
    height: 95vh;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 64px;
}
.chat-header {
    background: #000000;
    padding: 18px 24px;
    color: rgb(0, 0, 0);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    border-bottom: 2px solid #aaa341;
}
.chat-header h2 {
    font-weight: 600;
    font-size: 2rem;
    background: #fffc54;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-family: "Ruslan Display", sans-serif;
    font-style: normal;
}

.chat-container h3 {
    font-size: 1rem;
    background: #fffc54;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-style: normal;
    padding: 15px;
    border-top: 1px solid #d3c500;
}
.chat-container h2 {
    font-size: 2rem;
    background: #fffc54;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-family: "Ruslan Display", sans-serif;
    font-style: normal;
    padding: 15px;
}

.icon {
    width: 32px;
}
.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.9rem;
    background: rgb(255, 241, 118);
    padding: 6px 14px;
    border-radius: 8px;
}
.user-email {
    color: #000000;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout-btn {
    background: #c44536;
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.logout-btn:hover {
    background: #b13b2c;
    transform: scale(0.96);
}
.messages-area {
    height: 100%;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #000000;
    scroll-behavior: smooth;
}
.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeInUp 0.2s ease;
}
.message.own {
    align-self: flex-end;
}
.message.other {
    align-self: flex-start;
}
.message-bubble {
    padding: 10px 16px;
    border-radius: 16px;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.own .message-bubble {
    background: #fffeaf;
    color: rgb(0, 0, 0);
    border-bottom-right-radius: 3px;
}
.other .message-bubble {
    background: rgb(255, 241, 118);
    color: #000000;
    border-bottom-left-radius: 3px;
    border: 1px solid #ddd;
}
.message-meta {
    font-size: 0.7rem;
    margin: 4px 8px 0;
    color: #aaa341;
    display: flex;
    gap: 8px;
}
.own .message-meta {
    justify-content: flex-end;
}
.message-author {
    font-weight: 600;
}
.message-time {
    opacity: 0.7;
}
.input-area {
    background: #000000;
    backdrop-filter: blur(4px);
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #aaa341;
    
}
#messageInput {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 6px;
    background: #111111;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: 0.2s;
}
#messageInput:focus {
    box-shadow: 0 0 0 2px #aaa341;
}
#sendBtn {
    background: #fffc54;
    border: none;
    color: rgb(0, 0, 0);
    padding: 0 28px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}
#sendBtn:hover {
    background: #d8d400;
    transform: scale(0.99);
}
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.auth-card {
    background: #1d1d1d;
    padding: 32px 28px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    color: white;
    box-shadow: 0 20px 35px rgba(0,0,0,0.5);
}
.auth-card h3 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    text-align: center;
}
.auth-card input {
    width: 100%;
    padding: 14px 16px;
    margin: 10px 0;
    border: none;
    border-radius: 60px;
    background: #000000;
    color: rgb(255, 241, 118);
    font-size: 1rem;
    outline: none;
}
.auth-card input::placeholder {
    color: rgb(255, 255, 255);
}
.auth-card button {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: #d3c500;
    border: none;
    border-radius: 60px;
    font-weight: bold;
    color: rgb(0, 0, 0);
    font-size: 1rem;
    cursor: pointer;
}
.auth-card .toggle-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #d3c500;
    cursor: pointer;
}
.error-msg {
    background: #d9534f;
    padding: 8px;
    border-radius: 30px;
    text-align: center;
    font-size: 0.8rem;
    margin-top: 12px;
}
@keyframes fadeInUp {
    from {
opacity: 0;
transform: translateY(8px);
    }
    to {
opacity: 1;
transform: translateY(0);
    }
}
.messages-area::-webkit-scrollbar {
    width: 6px;
}
.messages-area::-webkit-scrollbar-track {
    background: #e8e8cf;
}
.messages-area::-webkit-scrollbar-thumb {
    background: #aca903;
    border-radius: 10px;
}
::selection{
    background-color: rgb(153, 153, 153);
    color: black;
}

.settings-btn {
    width: 32px;
}

/* bbcode */
.bb-quote {
    background: #f0f0f0;
    border-left: 3px solid #4CAF50;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 4px;
    font-style: italic;
}

.bb-code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    margin: 5px 0;
}

.bb-code code {
    background: none;
    color: inherit;
}

.bb-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px 0;
}

.bb-gif {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin: 5px 0;
}

#messageInput {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

#messageInput:focus {
    outline: none;
    border-color: #4CAF50;
}

.message-bubble strong {
    font-weight: bold;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble u {
    text-decoration: underline;
}

.message-bubble del {
    text-decoration: line-through;
}

.message-bubble a {
    color: #4CAF50;
    text-decoration: none;
}

.message-bubble a:hover {
    text-decoration: underline;
}



/* Videoplayer */
.video-container {
    position: relative;
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    max-width: 100%;
    width: 100%;
}

.video-preview {
    position: relative;
    cursor: pointer;
    display: block;
    line-height: 0;
}

.video-thumbnail {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-preview:hover .video-thumbnail {
    transform: scale(1.02);
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.video-preview:hover .video-play-button {
    background: rgba(255, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
    pointer-events: none;
}

.video-preview:hover .video-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-wrapper iframe, .video-player-wrapper video {
    width: 100%;
    height: auto;
    min-height: 250px;
    max-height: 400px;
    border: none;
    display: block;
}

.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    text-align: center;
}

/* Mobile */
@media (max-width: 1200px) {
    .video-play-button {
        width: 100px;
        height: 100px;
        font-size: 22px;
    }

    .video-player-wrapper iframe,
    .video-player-wrapper video {
        min-height: 200px;
    }

    .video-thumbnail {
        max-height: 200px;
    }
}
/* Онлайн индикатор в шапке */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgb(255, 241, 118);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: normal;
    cursor: pointer;
    transition: 0.2s;
}

.online-indicator:hover {
    background: rgb(255, 247, 175);
    transform: scale(1.02);
}

.online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Модальное окно со списком онлайн пользователей */
.online-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.online-modal-content {
    background: #3b3c1f;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.online-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #2e2b0f;
    border-bottom: 1px solid #5f602d;
}

.online-modal-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
    font-family: "Ruslan Display", sans-serif;
}

.online-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
    transition: 0.2s;
}

.online-modal-close:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

.online-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5e94a;
    margin-bottom: 8px;
    border-radius: 12px;
    transition: 0.2s;
}

.online-user-item:hover {
    background: #ffeb99;
    transform: translateX(4px);
}

.online-user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    animation: pulse 1.5s infinite;
}

.online-user-name {
    font-weight: 600;
    color: rgb(0, 0, 0);
    flex: 1;
}

.online-empty {
    text-align: center;
    padding: 40px;
    color: #c0bf8a;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .online-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .online-user-item {
        padding: 10px;
    }
    
    .online-user-name {
        font-size: 0.9rem;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .online-indicator {
        padding: 3px 10px;
        padding-bottom: 8px;
        font-size: 0.7rem;
    }
}
