/* Importando fontes do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #2C3E50;
    --secondary-color: #3498DB;
    --accent-color: #E74C3C;
    --background-color: #F5F6FA;
    --text-color: #2C3E50;
    --sidebar-width: 250px;
    --header-height: 70px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout Principal */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.sidebar-logo img {
    max-width: 120px;
    margin-bottom: 1rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1rem;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav i {
    margin-right: 10px;
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

/* Header */
.header {
    background-color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    border-radius: 12px;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* Botões */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Tabelas */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Mensagens Flash */
.flash {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.flash.success {
    background-color: #2ecc71;
    color: white;
}

.flash.danger {
    background-color: var(--accent-color);
    color: white;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1000;
        background-color: var(--primary-color);
        color: white;
        padding: 0.5rem;
        border-radius: 4px;
        cursor: pointer;
    }

    .chat-container {
        width: 100%;
        height: calc(100vh - 60px);
        margin-top: 60px;
    }

    .chat-messages {
        height: calc(100% - 60px);
    }

    .chat-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 10px;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    }
}

/* Elementos específicos para plataforma de música */
.music-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.music-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.music-progress {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.music-progress-bar {
    background-color: white;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Utilitários */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.p-2 { padding: 2rem; }

.profile-section {
    text-align: center;
    margin-bottom: 20px;
}

.profile-photo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-overlay i {
    color: white;
    font-size: 24px;
}

.profile-photo:hover .photo-overlay {
    opacity: 1;
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

/* Estilos do Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px;
    position: relative;
    z-index: 1;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8f9fa;
}

.chat-message {
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    align-self: flex-start;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-out;
}

.chat-message.own-message {
    background-color: #e3f2fd;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-message:not(.own-message) {
    border-bottom-left-radius: 5px;
}

.message-user {
    font-weight: bold;
    color: #1976d2;
    margin-right: 10px;
    font-size: 0.9em;
}

.message-time {
    font-size: 0.75em;
    color: #666;
    margin-left: 5px;
}

.message-content {
    margin-top: 5px;
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-status {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 10px 0;
    font-size: 0.85em;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 5px 10px;
    border-radius: 15px;
    align-self: center;
    max-width: 80%;
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    position: relative;
}

.chat-input input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: #1976d2;
}

.chat-input button {
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background-color: #1565c0;
    transform: scale(1.05);
}

.chat-input button i {
    font-size: 1.2em;
}

.emoji-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 10px;
    color: #666;
    transition: color 0.2s;
}

.emoji-button:hover {
    color: #333;
}

.emoji-picker-container {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.emoji-picker-container.visible {
    display: block;
}

/* Ajuste para o seletor de emoji */
.emoji-mart {
    border: none !important;
    border-radius: 8px !important;
}

.emoji-mart-search {
    padding: 10px !important;
}

.emoji-mart-category-label {
    font-size: 12px !important;
}

.emoji-mart-emoji {
    padding: 6px !important;
}

/* Ajuste para responsividade */
@media (max-width: 768px) {
    .emoji-picker-container {
        position: fixed;
        bottom: 60px;
        right: 10px;
        left: 10px;
        margin: 0;
    }
    
    .emoji-mart {
        width: 100% !important;
    }
}

/* Animação para novas mensagens */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Estilo para a barra de rolagem do chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color);
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.recent-activities, .recent-evaluations {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.activity-card, .evaluation-card {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.activity-card:hover, .evaluation-card:hover {
    background-color: var(--background-color);
}

.activity-card:last-child, .evaluation-card:last-child {
    border-bottom: none;
}

.activity-card h3, .evaluation-card h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.activity-date, .evaluation-date {
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0;
}

.activity-status {
    color: var(--secondary-color);
    font-weight: 500;
}

.evaluation-grade {
    color: var(--accent-color);
    font-weight: 600;
    margin: 5px 0;
}

.evaluation-comment {
    color: #666;
    font-style: italic;
    margin: 5px 0;
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        margin-bottom: 20px;
    }
    
    .dashboard-container {
        padding: 10px;
    }
}

/* Dashboard do Aluno */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-section {
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-section h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.activities-list, .evaluations-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: var(--hover-bg);
}

.list-item.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.list-item.empty p {
    margin: 0;
    font-style: italic;
}

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

.item-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.item-details {
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.tempo-estudo {
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
    font-weight: 500;
    color: #2C3E50;
}

.tempo-estudo i {
    margin-right: 5px;
    color: #3498DB;
}

.item-details .comentario {
    margin: 0.5rem 0 0;
    font-style: italic;
    color: var(--text-secondary);
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.status.concluido {
    background-color: var(--success-light);
    color: var(--success);
}

.status.pendente {
    background-color: var(--warning-light);
    color: var(--warning);
}

.nota {
    font-weight: 500;
    color: var(--primary);
}

.recent-activities, .recent-evaluations {
    margin-bottom: 2.5rem;
}

.recent-activities h2, .recent-evaluations h2 {
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
}

/* Mensagem de feedback */
.mensagem {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.mensagem.erro {
    background-color: var(--accent-color);
}

.mensagem.sucesso {
    background-color: #2ecc71;
}

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

/* Responsividade */
@media (max-width: 768px) {
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .item-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Estilos para Usuários Online */
.online-users-container {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.online-users-container h3 {
    font-size: 1rem;
    color: white;
    margin-bottom: 10px;
}

.online-users-list {
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.online-users-list li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.online-badge {
    background-color: #28a745;
    color: white;
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.text-success {
    color: #28a745;
}

/* Estilo para usuário online no chat */
.user-online {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    margin-right: 5px;
}

/* Em telas pequenas, ocultar a lista de usuários online */
@media (max-width: 768px) {
    .online-users-container {
        display: none;
    }
}

/* Estilos para aulas ao vivo */
.aula-ativa-status {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
}

.aula-ativa-status p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.aula-ativa-status span.badge {
    display: inline-block;
    margin-bottom: 10px;
}

#card-aula-ao-vivo .btn {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Quando a aula está ativa no card do dashboard */
#card-aula-ao-vivo {
    padding-top: 15px;
    padding-bottom: 15px;
}

#card-aula-ao-vivo.pulse-highlight {
    animation: pulse-animation 2s infinite;
    border: 2px solid #dc3545;
}

/* Garante espaçamento em dispositivos móveis */
@media (max-width: 768px) {
    .aula-ativa-status {
        margin-bottom: 15px;
    }
    
    #card-aula-ao-vivo .btn {
        display: block;
        width: 100%;
        margin-top: 10px;
    }
    
    .aula-info {
        flex-direction: column;
    }
    
    .aula-controles {
        margin-top: 15px;
        margin-left: 0;
    }
}