:root {
    --bg-dark: #1a1a1a;
    --bg-darker: #121212;
    --bg-light: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --primary-color: #1976d2;
    --primary-hover: #1565c0;
    --border-color: #404040;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.chat-container {
    position: relative;
    height: 100%;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    overflow: hidden;
}

.chat-container.admin {
    max-height: calc(100vh - 60px);
}

.chat-container:not(.admin) {
    max-height: calc(100vh - 60px);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

.chat-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
}

.connection-status {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    background-color: #4CAF50;
    color: white;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bg-darker);
    min-height: 0;
    margin-bottom: 60px; /* Espaço para o input */
    height: calc(100% - 160px); /* Altura base para usuários normais */
}

.chat-container.admin #chat-messages {
    height: calc(100% - 145px); /* Altura para admin (60px do input + 24px das abas) */
}

.message {
    position: relative;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.message:hover .delete-message {
    display: block;
}

.delete-message {
    position: absolute;
    right: 8px;
    top: 8px;
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.delete-message:hover {
    background-color: rgba(255, 68, 68, 0.1);
}

.message:last-child {
    margin-bottom: 0.5rem; /* Adiciona margem apenas na última mensagem */
}

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

.message-username {
    font-weight: bold;
    color: var(--primary-color);
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.message-content {
    color: var(--text-primary);
    word-break: break-word;
}

.system-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0.8rem 0;
}

.chat-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem;
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    z-index: 2;
}

#chat-form {
    display: flex;
    gap: 0.5rem;
    max-width: 100%;
}

#message-input {
    flex: 1;
    padding: 0.6rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

#message-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#send-button {
    padding: 0.6rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

#send-button:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

#send-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Overlay de Login/Registro */
.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: flex;
}

.auth-form {
    background-color: var(--bg-darker);
    padding: 1.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 350px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

.auth-form h2 {
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    text-align: center;
    font-size: 1.3rem;
}

.auth-form .form-group {
    margin-bottom: 0.8rem;
}

.auth-form label {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 0.6rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.auth-form .btn-container {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.auth-form .btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

.auth-form .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.auth-form .btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.auth-form .btn:hover {
    opacity: 0.9;
}

.auth-form .error-message {
    color: #ff4444;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
}

/* Responsividade */
@media (max-width: 768px) {
    .chat-container {
        height: 50vh;
        max-height: 50vh;
        position: relative;
    }

    .auth-form {
        margin: 1rem;
        padding: 1.2rem;
    }

    .auth-form .btn-container {
        flex-direction: column;
    }

    .chat-input-container {
        padding: 0.5rem;
        position: sticky;
        bottom: 0;
    }
}

/* Estilo das abas */
.chat-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

.tab-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button {
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.tab-button:hover {
    background-color: var(--bg-light);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    height: 100%;
}

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

/* Estilos para mensagens de erro */
.error-message {
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Ajustes para o painel admin */
.admin-panel {
    height: 100%;
    padding: 1rem;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-panel h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.admin-content {
    height: calc(100% - 2.5rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-darker);
    border-radius: 0.5rem;
}

.stat-item {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-item h4 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-item p {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

/* Estilos para o painel de controle de transmissão */
.stream-controls {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-darker);
    border-radius: 0.5rem;
}

.stream-controls h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stream-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stream-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stream-form label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stream-form input,
.stream-form textarea,
.stream-form select {
    padding: 0.5rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.stream-form textarea {
    resize: vertical;
    min-height: 80px;
}

.stream-form .btn-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.stream-form .btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.stream-form .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.stream-form .btn-success {
    background-color: #28a745;
    color: white;
}

.stream-form .btn-danger {
    background-color: #dc3545;
    color: white;
}

.stream-form .btn:hover {
    opacity: 0.9;
}

/* Estilos para notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.info {
    background-color: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estilos para informações da transmissão */
/* .player-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 56px);
    background-color: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
} */

.player-container video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    background-color: black;
}

.stream-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    color: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stream-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.stream-description {
    margin: 0.5rem 0;
    font-size: 1rem;
    opacity: 0.9;
    color: white;
}

.stream-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

.stream-status.offline {
    background-color: #dc3545;
}

.stream-status.live {
    background-color: #28a745;
    animation: pulse 2s infinite;
}

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

.chat-input input:disabled {
    background-color: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #333;
    opacity: 0.7;
}

.chat-input button:disabled {
    background-color: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #333;
    opacity: 0.7;
}

/* Estilos para o toggle do chat */
#toggle-chat {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#toggle-chat i {
    transition: transform 0.3s ease;
}

#toggle-chat:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#chat-sidebar {
    transition: all 0.3s ease;
    width: 450px;
    position: fixed;
    right: 0;
    top: 56px; /* Altura da navbar */
    bottom: 0;
    background-color: var(--bg-dark);
    z-index: 1000;
}

#chat-sidebar.collapsed {
    transform: translateX(100%);
}

#player-container {
    transition: all 0.3s ease;
    width: calc(100% - 450px);
    /* margin-right: 450px; */
    /* height: calc(100vh - 56px); */
    /* max-height: calc(100vh - 56px); */
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#player-container.expanded {
    width: 100%;
    margin-right: 0;
}

#player-container.expanded .player-container {
    /* max-height: calc(100vh - 56px); */
}

#player-container.expanded video {
    /* max-height: calc(100vh - 56px); */
}

.player-container video {
    /* width: 100%; */
    /* height: 100%; */
    object-fit: contain;
}

.stream-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.stream-description {
    margin: 0.5rem 0;
    font-size: 1rem;
    opacity: 0.9;
    color: white;
}

.stream-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

.stream-status.offline {
    background-color: #dc3545;
}

.stream-status.live {
    background-color: #28a745;
    animation: pulse 2s infinite;
}

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

.chat-input input:disabled {
    background-color: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #333;
    opacity: 0.7;
}

.chat-input button:disabled {
    background-color: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #333;
    opacity: 0.7;
}

.container-fluid {
    height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    overflow: hidden;
    padding: 0;
}

.container-fluid > div {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
} 