/* ========================================
   ESTILOS ESPECÍFICOS DEL PANEL PROFESOR
   ======================================== */

/* ========================================
   PANTALLA DE LOGIN
   ======================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   FORMULARIOS
   ======================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-control {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    border: 2px solid #E0E5F0;
    border-radius: 10px;
    background: var(--bg-main);
    color: var(--text-dark);
    transition: all var(--transition-normal);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(77, 150, 255, 0.1);
}

.form-control-file {
    padding: 0.5rem;
    font-size: 0.95rem;
    font-family: 'Quicksand', sans-serif;
    border: 2px solid #E0E5F0;
    border-radius: 10px;
    background: var(--bg-main);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* ========================================
   BOTONES
   ======================================== */
.btn-primary {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: #4A5368;
    transform: translateY(-2px);
}

.btn-link {
    display: inline-block;
    text-align: center;
    padding: 0.75rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: #3D7DE6;
}

.btn-logout {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    background: #FF6B6B;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: #EE5A5A;
    transform: translateY(-2px);
}

.btn-add-word {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    background: var(--primary-color);
    color: var(--text-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-add-word:hover {
    background: #FFC700;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-save {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-save:hover:not(:disabled) {
    background: #5AB968;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-save:disabled {
    background: #CCC;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-play-audio {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-play-audio:hover {
    background: #3D7DE6;
}

/* ========================================
   MENSAJES DE ERROR
   ======================================== */
.error-message {
    padding: 0.875rem;
    background: #FFE5E5;
    color: #D32F2F;
    border-radius: 8px;
    border-left: 4px solid #D32F2F;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ========================================
   PANEL PRINCIPAL DEL PROFESOR
   ======================================== */
.teacher-panel {
    min-height: 100vh;
}

.teacher-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.grade-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    margin-left: 1rem;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.teacher-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ========================================
   CONTROLES
   ======================================== */
.controls-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Búsqueda */
.search-box {
    width: 100%;
}

/* Botones de ordenamiento */
.control-item.sort-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sort-buttons .sort-btn {
    flex: 1;
    min-width: 140px;
}

/* Botón agregar palabra */
.add-word-box {
    width: 100%;
}

.btn-add-word {
    width: 100%;
}

.word-count {
    text-align: center;
    margin-top: 1rem; /* Añade esta línea */
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 600;
}

/* ========================================
   GRID DE PALABRAS DEL PROFESOR
   ======================================== */
.teacher-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Tarjeta de Palabra Editable */
.teacher-word-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    position: relative;
}

.teacher-word-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.teacher-word-card .word-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(77, 150, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.teacher-word-card .word-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: block;
}

.teacher-word-card .card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-edit,
.btn-delete,
.btn-test-audio {
    flex: 1;
    min-width: 70px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-edit {
    background: var(--accent-color);
    color: white;
}

.btn-edit:hover {
    background: #3D7DE6;
}

.btn-delete {
    background: #FF6B6B;
    color: white;
}

.btn-delete:hover {
    background: #EE5A5A;
}

.btn-test-audio {
    background: var(--secondary-color);
    color: white;
}

.btn-test-audio:hover {
    background: #5AB968;
}

/* ========================================
   SECCIÓN DE GUARDAR
   ======================================== */
.save-section {
    text-align: center;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.save-info {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #E0E5F0;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-dark);
}

.word-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-actions button {
    flex: 1;
}

.audio-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.audio-name {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */


@media (max-width: 768px) {
    .control-item.sort-buttons {
        flex-direction: column;
    }

    .sort-buttons .sort-btn {
        min-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .teacher-words-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 1.5rem;
    }
}

/* Para pantallas muy grandes */
@media (min-width: 1200px) {
    .controls-section {
        padding: 2rem;
    }

    .controls-grid {
        grid-template-columns: 3fr 1fr;
    }
}

.btn-primary:hover {
    background: #5AB968;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}