/* Estilos globales */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Estilos de autenticación */
.auth-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 350px;
}

.auth-container h2 {
    margin-top: 0;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.auth-btn {
    width: 100%;
    padding: 10px;
    background-color: #4299e1;
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.auth-btn:hover {
    background-color: #3182ce;
}

.toggle-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #4299e1;
    cursor: pointer;
}

.toggle-link:hover {
    text-decoration: underline;
}

.error-msg {
    color: #e53e3e;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    display: none;
}

.hidden {
    display: none !important;
}

/* Estilos de la aplicación */
.app-screen {
    padding: 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-container h2 {
    margin: 0;
    color: #333;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-left: 5px;
}

.badge-user {
    background-color: #48bb78;
    color: white;
}

.badge-profesor {
    background-color: #4299e1;
    color: white;
}

.badge-director {
    background-color: #e53e3e;
    color: white;
}

.badge-admin {
    background-color: #e53e3e;
    color: white;
}

.user-info {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-logout {
    background-color: #718096;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-logout:hover {
    background-color: #4a5568;
}

/* Estilos del panel del profesor */
.profesor-container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-panel {
    background-color: #fffaf0;
    border: 1px solid #feebc8;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.admin-panel h3 {
    margin-top: 0;
    color: #dd6b20;
    font-size: 18px;
}

.actions-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.actions-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 10px;
    font-size: 13px;
}

.log-table th,
.log-table td {
    padding: 8px;
    border: 1px solid #fbd38d;
    text-align: left;
}

.log-table th {
    background-color: #feebc8;
    color: #7b341e;
}

.actions-cell {
    display: flex;
    gap: 6px;
}

.btn-action-admin {
    background-color: #4299e1;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-action-admin:hover {
    background-color: #2b6cb0;
}

.btn-delete-admin {
    background-color: #e53e3e;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-delete-admin:hover {
    background-color: #c53030;
}

.editing-banner {
    background-color: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Estilos de la tabla de notas */
.tabla-container {
    width: 100%;
    overflow-x: auto;
}

.main-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.main-table th,
.main-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.main-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #444;
}

.main-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.asignatura-row {
    background-color: #e2e8f0 !important;
    font-weight: bold;
}

.asignatura-row td {
    color: #1a202c;
}

.main-table input {
    width: 95%;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 4px;
}

.main-table input:focus {
    outline: 2px solid #4299e1;
    background: #fff;
}

.main-table input[readonly] {
    cursor: not-allowed;
    color: #4a5568;
}

.main-table input[readonly]:focus {
    outline: none;
    background: transparent;
}

.promedio-cell {
    font-weight: bold;
    background-color: #edf2f7;
}

/* Estilos para el panel de notas del profesor */
.notas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.notas-actions {
    display: flex;
    gap: 10px;
}

.btn-guardar {
    background-color: #48bb78;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-guardar:hover {
    background-color: #38a169;
}

.btn-pdf {
    background-color: #e53e3e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-pdf:hover {
    background-color: #c53030;
}

/* Mensaje de guardado */
.guardado-mensaje {
    background-color: #48bb78;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.guardado-mensaje.show {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Estilos para el panel del director */
.stats-container {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.stat-card {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex: 1;
    text-align: center;
}

.stat-card h4 {
    margin-top: 0;
    color: #4a5568;
    font-size: 14px;
}

.stat-card p {
    margin: 10px 0 0;
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

/* Estilos responsivos para móviles */
@media (max-width: 768px) {
    .main-table {
        display: block;
    }

    .main-table thead {
        display: none;
    }

    .main-table tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    .main-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
        border-bottom: 1px solid #eee;
    }

    .main-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 10px;
        color: #444;
    }

    .main-table td:last-child {
        border-bottom: none;
    }

    .asignatura-row {
        display: table-row;
    }

    .asignatura-row td {
        display: table-cell;
        padding: 8px;
    }

    .asignatura-row td::before {
        content: "";
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-logout {
        width: 100%;
        margin-bottom: 5px;
    }

    .stats-container {
        flex-direction: column;
    }
}