/* =====================================================
   PANTALLA DE GESTIÓN DE ALUMNOS
   ===================================================== */

.manage-students-screen {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f5f5f5;
}

/* Header */
.screen-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.back-button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #f5f5f5;
    transform: translateX(-2px);
}

.screen-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    color: #333;
    margin: 0;
}

.screen-title .material-icons {
    font-size: 32px;
    color: #4CAF50;
}

/* Mensajes */
.success-message,
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4CAF50;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sección de búsqueda */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: white;
    border-color: #4CAF50;
}

.search-box .material-icons {
    color: #666;
    font-size: 24px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.clear-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.clear-button:hover {
    background: rgba(0,0,0,0.05);
}

.clear-button .material-icons {
    font-size: 20px;
    color: #666;
}

.search-info {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

.student-count {
    color: #4CAF50;
    font-weight: 600;
}

/* Loading */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lista de usuarios */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.user-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.user-card.is-student {
    border-left-color: #4CAF50;
    background: linear-gradient(to right, #f1f8f4 0%, white 50%);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.user-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.user-card.is-student .user-icon {
    background: #e8f5e9;
}

.user-icon .material-icons {
    font-size: 28px;
    color: #666;
}

.user-card.is-student .user-icon .material-icons {
    color: #4CAF50;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.user-email {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subscription-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-trial {
    background: #fff3e0;
    color: #e65100;
}

.status-expired {
    background: #ffebee;
    color: #c62828;
}

.status-cancelled {
    background: #f5f5f5;
    color: #666;
}

/* Toggle de alumno */
.user-actions {
    display: flex;
    align-items: center;
}

.toggle-student {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-student input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-student input:checked + .toggle-slider {
    background: #4CAF50;
}

.toggle-student input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-student input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    min-width: 60px;
}

.toggle-student input:checked ~ .toggle-label {
    color: #4CAF50;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.empty-state .material-icons {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .manage-students-screen {
        padding: 15px;
    }

    .screen-title {
        font-size: 20px;
    }

    .user-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
