/* Reset e Configurações Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3a8a;
    --primary-hover: #3b82f6;
    --secondary-color: #64748b;
    --background-light: #f8fafc;
    --background-dark: #1f2937;
    --text-light: #111827;
    --text-dark: #e5e7eb;
    --accent-color: #10b981;
    --error-color: #ef4444;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.2);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-light);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

body.dark-mode {
    background: var(--background-dark);
    color: var(--text-dark);
}

/* Estilização da Navbar */
.navbar {
    background: var(--primary-color);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: -0.025em;
}

.navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-hover) !important;
}

.navbar-nav .nav-link.active {
    background: var(--primary-hover);
}

/* Container Principal */
.container {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.dark-mode .card {
    background: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -0.025em;
}

.dark-mode .card h2 {
    color: var(--text-dark);
}

/* Formulários */
.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.dark-mode .form-label {
    color: var(--text-dark);
}

.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.dark-mode .form-control, .dark-mode .form-select {
    background: #4b5563;
    border-color: #6b7280;
    color: var(--text-dark);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
    outline: none;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transition: var(--transition);
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: #ffffff;
}

/* Alertas */
.alert {
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

.alert-danger {
    background: #fee2e2;
    color: var(--error-color);
}

.dark-mode .alert-danger {
    background: #7f1d1d;
    color: #fecaca;
}

/* Dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 2rem auto;
}

.card-header {
    background: #f1f5f9;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.dark-mode .card-header {
    background: #4b5563;
    border-bottom: 1px solid #6b7280;
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
}

.list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.dark-mode .list-group-item {
    border-bottom: 1px solid #6b7280;
}

.list-group-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-mode .list-group-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.list-group-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

.dark-mode .list-group-item strong {
    color: var(--text-dark);
}

.list-group-item small {
    display: block;
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.badge {
    font-size: 0.8rem;
    padding: 0.5em 1em;
    border-radius: 12px;
    background: var(--accent-color);
    color: #ffffff;
}

/* Links */
a {
    color: var(--primary-hover);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.dark-mode a {
    color: var(--primary-hover);
}

.dark-mode a:hover {
    color: var(--text-dark);
}

/* Botão de Alternância de Tema */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.dark-mode .theme-toggle {
    color: var(--text-dark);
}

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 80vh;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    background: #ffffff;
}

.dark-mode .chat-container {
    background: #374151;
    border-color: #6b7280;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark-mode .chat-messages {
    border-bottom: 1px solid #6b7280;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.chat-message.sent {
    align-items: flex-end;
}

.chat-message.received {
    align-items: flex-start;
}

.chat-message .message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.chat-message.sent .message-content {
    background: var(--primary-color);
    color: #ffffff;
}

.chat-message.received .message-content {
    background: #e5e7eb;
    color: var(--text-light);
}

.dark-mode .chat-message.received .message-content {
    background: #4b5563;
    color: var(--text-dark);
}

.chat-message .message-meta {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.chat-form {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-form textarea {
    resize: none;
    height: 60px;
}

.chat-form input[type="file"] {
    font-size: 0.9rem;
}

/* Estilização de Mídia */
.media-content {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.media-content img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.media-content video, .media-content audio {
    width: 100%;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .alert, .list-group-item, .chat-message {
    animation: fadeIn 0.5s ease-in-out;
}

/* Acessibilidade */
:focus {
    outline: 3px solid var(--primary-hover);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Responsividade */
@media (max-width: 992px) {
    .container {
        padding: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .dashboard-container {
        margin: 1.5rem;
    }

    .chat-container {
        height: 40vh;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 1rem;
    }

    .card {
        max-width: 100%;
        padding: 1rem;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .form-control, .form-select {
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .list-group-item {
        padding: 0.75rem 1rem;
    }
    .card chat-container {
        height: 8000vh;
    }
   .chat-container {
    display: flex;
    flex-direction: column;
    height: 130vh; /* Aumentado de 70vh para 80vh */
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    background: #ffffff;
    padding: 1rem;
    gap: 1rem;
}

.dark-mode .chat-container {
    background: #374151;
    border-color: #6b7280;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.dark-mode .chat-messages {
    background: #4b5563;
    border-color: #6b7280;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.chat-message.sent {
    align-items: flex-end;
}

.chat-message.received {
    align-items: flex-start;
}

.chat-message .message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.chat-message.sent .message-content {
    background: var(--primary-color);
    color: #ffffff;
}

.chat-message.received .message-content {
    background: #e5e7eb;
    color: var(--text-light);
}

.dark-mode .chat-message.received .message-content {
    background: #4b5563;
    color: var(--text-dark);
}

.chat-message .message-meta {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.chat-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chat-form textarea {
    flex: 1 1 100%;
    resize: none;
    min-height: 80px;
    max-height: 200px;
    padding: 0.75rem 1rem;
}

.chat-form input[type="file"] {
    flex: 1 1 100%;
    font-size: 0.9rem;
}

.chat-form button {
    flex: 1 1 100%;
    padding: 0.85rem;
}

/* Estilização de Mídia */
.media-content {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.media-content img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.media-content video, .media-content audio {
    width: 100%;
}