/* Estilos generales del Admin Panel */
body {
    background-color: #0d0d0d;
    color: #f0f0f0;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    margin: 0;
    overflow-x: hidden;
}

.admin-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #1a1a1a;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.sidebar-header h2 {
    color: #ffc107;
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    margin: 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #f0f0f0;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    gap: 10px;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: #2a2a2a;
    color: #ffc107;
    border-left: 5px solid #ffc107;
}

.sidebar-nav li a i {
    font-size: 1.2em;
}

/* Main Content Area */
.admin-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #0d0d0d;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 2.2em;
    color: #ffc107;
    font-family: 'Playfair Display', serif;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #ccc;
}

.user-info i {
    font-size: 1.5em;
    color: #ffc107;
}

.content-section {
    display: none; /* Oculta todas las secciones por defecto */
}

.content-section.active {
    display: block; /* Muestra la sección activa */
}

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

.section-header h2 {
    font-size: 1.8em;
    color: #f0f0f0;
    font-family: 'Playfair Display', serif;
    margin: 0;
}

/* Botones generales */
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95em;
}

.btn-primary {
    background-color: #ffc107;
    color: #000;
    border: none;
}
.btn-primary:hover {
    background-color: #e0a800;
}

.btn-secondary {
    background-color: transparent;
    color: #ffc107;
    border: 2px solid #ffc107;
}
.btn-secondary:hover {
    background-color: #ffc107;
    color: #000;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border: none;
}
.btn-danger:hover {
    background-color: #c82333;
}

/* Tablas de administración */
.admin-table-container {
    overflow-x: auto; /* Permite scroll horizontal en tablas grandes */
    margin-bottom: 20px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #1a1a1a;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Ancho mínimo para la tabla */
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
    color: #f0f0f0;
    vertical-align: top; /* Alineación vertical para celdas con mucho texto */
}

.admin-table th {
    background-color: #2a2a2a;
    font-weight: 600;
    text-transform: uppercase;
    color: #ffc107;
    font-size: 0.85em;
}

.admin-table tbody tr:hover {
    background-color: #212121;
}

/* Estilos de botones de acción en la tabla */
.admin-table .action-buttons button {
    margin-right: 8px;
    padding: 6px 10px;
    font-size: 0.8em;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.admin-table .action-buttons button:last-child {
    margin-right: 0;
}

/* Mensajes de carga e información */
.loading-message, .info-message {
    text-align: center;
    padding: 20px;
    color: #ffc107;
    font-size: 1.1em;
}
.error-message {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    font-size: 1.1em;
}

/* Modal base styles (similar a los de cursos.css pero adaptado) */
.modal {
    display: none;
    position: fixed;
    z-index: 10001; /* Más alto que el sidebar y el contenido */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* Fondo más oscuro */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 700px; /* Ancho ajustable para modales de admin */
    box-shadow: 0 5px 20px rgba(0,0,0,0.7);
    position: relative;
    color: #f0f0f0;
    animation-name: animatetop;
    animation-duration: 0.4s;
    border: 1px solid rgba(255, 193, 7, 0.3); /* Borde sutil */
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}
.close-button:hover, .close-button:focus {
    color: #ffc107;
    text-decoration: none;
}

.modal-content h2, .modal-content h3 {
    color: #ffc107;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #f0f0f0;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #2a2a2a;
    color: #f0f0f0;
    font-size: 1em;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}
.form-group textarea {
    resize: vertical;
}

#saveCourseBtn, #saveDealerBtn, #saveAnnounceBtn { /* Agregado #saveAnnounceBtn */
    width: 100%;
    margin-top: 20px;
}

.form-message {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-weight: bold;
    color: #f0f0f0;
}
.form-message.success { background-color: #28a745; color: #fff; }
.form-message.error { background-color: #dc3545; color: #fff; }
.form-message.loading { background-color: #ffc107; color: #000; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* Estilos para el select del status */
.status-select {
    padding: 8px 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #2a2a2a;
    color: #f0f0f0;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.status-select:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}

/* Estilos de color para las opciones del select (solo visible cuando el select está abierto) */
.status-select option[value="Abierto"] { background-color: #45e30b; color: #212121; }
.status-select option[value="En Progreso"] { background-color: #007bff; color: #fff; }
.status-select option[value="Próximamente"] { background-color: rgba(0, 0, 0, 0.6); color: #fff; }
.status-select option[value="Cerrado"] { background-color: #dc3545; color: #fff; }
.status-select option[value="Default"] { background-color: #6c757d; color: #fff; }

/* Estilos para el formulario de anuncios */
.admin-form-card {
    background-color: #1a1a1a;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    max-width: 600px; /* Ancho máximo para el formulario */
    margin: 0 auto; /* Centrar el formulario */
}
.admin-form-card h3 {
    color: #f0f0f0;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
}


/* Media Queries para Responsive */
@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .sidebar-nav li a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0.9em;
    }
    .sidebar-nav li a.active {
        border-left: none;
        border-bottom: 3px solid #ffc107;
    }
    .admin-content {
        padding: 20px;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .admin-header h1 {
        font-size: 1.8em;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .section-header h2 {
        font-size: 1.5em;
    }
    .btn {
        width: 100%;
    }
    .admin-table-container {
        border-radius: 0; /* Sin bordes redondeados en móvil para tablas */
    }
    .admin-table th, .admin-table td {
        padding: 8px 10px;
        font-size: 0.8em;
    }
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .close-button {
        font-size: 24px;
        top: 5px;
        right: 15px;
    }
}
