@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: #0a0a0a;
    color: #f0f0f0;
    text-align: center;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

.main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.main-header {
    margin-bottom: 40px;
    animation: fadeIn 1s ease-in-out;
}

h1 {
    font-size: 3em;
    font-weight: 700;
    margin: 0;
    letter-spacing: 2px;
    color: #f0f0f0;
}

.main-header p {
    font-size: 1.2em;
    font-style: italic;
    color: #aaa;
    margin-top: 10px;
}

.video-container {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    background: #181818;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(255,255,255,0.05);
    padding: 32px;
    text-align: center;
}

.stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

h2 {
    color: #f0f0f0;
    font-size: 2em;
    margin: 0;
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #282828;
    border-radius: 5px;
    font-size: 14px;
    color: #aaa;
}

.viewer-count i {
    color: #43B581;
}

#viewer-number {
    font-weight: 600;
    color: #f0f0f0;
}

/* Video wrapper with aspect ratio */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Remove black bars */
    background: #000;
}

.offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    z-index: 10;
}

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

.offline-overlay h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin: 0;
}

.offline-overlay p {
    position: absolute;
    top: calc(50% + 50px);
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Stream controls */
.stream-controls {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.stream-controls button {
    padding: 10px 20px;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.stream-controls button:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.stream-controls button:active {
    transform: translateY(0);
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #282828;
    border-radius: 5px;
    font-size: 14px;
}

.quality-selector label {
    color: #aaa;
    font-weight: 500;
}

.quality-selector select {
    background: #383838;
    color: #f0f0f0;
    border: 1px solid #484848;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-selector select:hover {
    border-color: #5865F2;
}

.quality-selector select:focus {
    outline: none;
    border-color: #5865F2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.stream-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #282828;
    border-radius: 5px;
    font-size: 14px;
    color: #aaa;
}

.stream-status .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: pulse 2s infinite;
}

.stream-status.live .status-indicator {
    background: #43B581;
}

.stream-status.offline .status-indicator {
    background: #747F8D;
    animation: none;
}

.stream-status.loading .status-indicator {
    background: #FAA61A;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Comments section */
.comments-section {
    margin-top: 32px;
    background: #202020;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.comments-section h3 {
    color: #f0f0f0;
    font-size: 1.3em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-section h3 i {
    color: #5865F2;
}

.chat-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discord-login-btn {
    padding: 8px 16px;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.discord-login-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #282828;
    border-radius: 6px;
    font-size: 14px;
}

.user-info i {
    color: #5865F2;
    font-size: 18px;
}

#discord-username {
    font-weight: 600;
    color: #f0f0f0;
}

/* Moderation controls */
.mod-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mod-btn {
    padding: 8px 14px;
    background: #F04747;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mod-btn:hover {
    background: #D63939;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 71, 71, 0.4);
}

.comments-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 10px;
    background: #181818;
    border-radius: 6px;
}

.comments-container::-webkit-scrollbar {
    width: 8px;
}

.comments-container::-webkit-scrollbar-track {
    background: #282828;
    border-radius: 4px;
}

.comments-container::-webkit-scrollbar-thumb {
    background: #484848;
    border-radius: 4px;
}

.comments-container::-webkit-scrollbar-thumb:hover {
    background: #585858;
}

.comment-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.comment-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #444;
}

.comment-placeholder p {
    margin: 0;
    font-size: 16px;
}

.comment {
    margin-bottom: 16px;
    padding: 12px;
    background: #282828;
    border-radius: 6px;
    transition: background 0.2s;
}

.comment:hover {
    background: #303030;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.comment-header i {
    color: #5865F2;
}

.comment-author {
    font-weight: 600;
    color: #f0f0f0;
}

.comment-time {
    color: #888;
    margin-left: auto;
}

.comment-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.action-btn {
    padding: 4px 8px;
    background: transparent;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #383838;
    color: #f0f0f0;
}

.mute-btn:hover {
    border-color: #FAA61A;
    color: #FAA61A;
}

.kick-btn:hover {
    border-color: #F04747;
    color: #F04747;
}

.ban-btn:hover {
    border-color: #992D22;
    color: #992D22;
    background: #992D22;
    color: white;
}

.comment-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-input-area {
    display: flex;
    gap: 10px;
}

.comment-input-area input {
    flex: 1;
    padding: 12px 16px;
    background: #282828;
    border: 1px solid #383838;
    border-radius: 6px;
    color: #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
}

.comment-input-area input:focus {
    outline: none;
    border-color: #5865F2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.comment-input-area input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-input-area button {
    padding: 12px 20px;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.comment-input-area button:hover:not(:disabled) {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.comment-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #202020;
    padding: 0;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    color: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f0f0f0;
}

.banned-list {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.banned-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #282828;
    border-radius: 6px;
    margin-bottom: 10px;
}

.banned-user-item span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f0f0f0;
}

.unban-btn {
    padding: 6px 12px;
    background: #43B581;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.unban-btn:hover {
    background: #3AA76D;
    transform: translateY(-2px);
}

.video-list {
    margin-top: 24px;
    text-align: left;
}

.video-list a {
    display: block;
    color: #7c3aed;
    margin-bottom: 8px;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.video-list a:hover {
    color: #a78bfa;
}

.main-footer {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    border-top: 1px solid #333;
    background-color: #0a0a0a;
    animation: fadeIn 1s ease-in-out 1s;
    animation-fill-mode: both;
    position: relative;
    z-index: 10;
    margin-top: auto;
}

.back-button {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 10px 15px;
}

.back-button:hover {
    color: #f0f0f0;
    background: #181818;
}

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

@media (max-width: 768px) {
    .main-container {
        padding: 20px 5px;
    }
    .video-container {
        padding: 16px;
    }
    h1 {
        font-size: 2em;
    }
    .stream-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stream-controls {
        flex-direction: column;
        width: 100%;
    }
    .stream-controls button,
    .quality-selector,
    .stream-status {
        width: 100%;
    }
    .comment-input-area {
        flex-direction: column;
    }
    .comment-input-area button {
        width: 100%;
    }
    .chat-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .mod-controls {
        width: 100%;
    }
    .mod-btn {
        flex: 1;
        justify-content: center;
    }
}
