/* ============================================
   ESTILOS ADMINISTRADOR
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header Administrador */
.admin-header {
    background: #2c3e50;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-header nav {
    display: flex;
    gap: 1rem;
}

/* Botones */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Contenedor Principal */
.admin-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-main h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.login-hint {
    margin-top: 1rem;
    text-align: center;
    color: #7f8c8d;
}

/* Formularios */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Opciones Múltiples */
.option-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.option-input {
    flex: 1;
}

/* Secciones */
.projects-section, .questions-section {
    margin-bottom: 3rem;
}

.projects-section h2, .questions-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Tarjetas de Proyectos */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.project-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

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

.project-card.selected {
    border-color: #3498db;
    background: #f8f9ff;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.project-link {
    text-decoration: none;
    color: #2c3e50;
}

.project-link:hover {
    color: #3498db;
}

.project-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #3498db;
    color: white;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.info-message {
    background: #e3f2fd;
    color: #1976d2;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
}

/* Tarjetas de Preguntas */
.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.question-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.question-card.active {
    border-left: 4px solid #27ae60;
}

.question-header {
    margin-bottom: 1rem;
}

.question-header h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.question-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ecf0f1;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.question-info {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.question-info p {
    margin-bottom: 0.5rem;
}

.question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

/* Estados */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: #7f8c8d;
    font-size: 1.125rem;
}

/* Alertas */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fee;
    color: #c33;
    border-left: 4px solid #e74c3c;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border-left: 4px solid #27ae60;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Modal QR */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

#qrContainer {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

#qrContainer img {
    border: 4px solid #f0f0f0;
    border-radius: 8px;
}

#qrCode {
    margin: 1rem 0;
    font-weight: bold;
    color: #2c3e50;
}

/* Formulario de Pregunta */
.question-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .questions-grid {
        grid-template-columns: 1fr;
    }

    .question-actions {
        flex-direction: column;
    }

    .question-actions .btn {
        width: 100%;
    }
}
