/* Estilos para la aplicación web estática */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-color: #f9f9f9;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Cabecera */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    color: var(--primary-color);
}

.api-status {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.status-label {
    margin-right: 0.5rem;
    font-weight: bold;
}

.status-value {
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    background-color: #6c757d;
    color: white;
}

.status-value.online {
    background-color: var(--success-color);
}

.status-value.error {
    background-color: var(--error-color);
}

/* Formulario de búsqueda */
.search-form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.search-form h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

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

.form-filters {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.form-filters h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary-color);
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.btn.primary {
    background-color: var(--secondary-color);
    color: white;
}

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

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

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

/* Sección de resultados */
.results-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.results-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.search-summary {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-item {
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed);
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.result-title {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.result-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.result-score {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.subtarea-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.result-ids {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin-left: 1rem;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #555;
}

.result-meta span {
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.result-client::before,
.result-project::before,
.result-date::before {
    display: inline-block;
    margin-right: 0.25rem;
    font-weight: 500;
}

.result-client::before {
    content: "Cliente:";
}

.result-project::before {
    content: "Proyecto:";
}

.result-date::before {
    content: "Fecha:";
}

.result-description {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.result-details {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.result-summary {
    margin-bottom: 1rem;
}

.result-summary:not(:empty)::before {
    content: "Resumen:";
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.result-activities {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.result-activities:not(:empty)::before {
    content: "Actividades:";
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.activity-item {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid var(--secondary-color);
}

.activity-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

/* Sección de carga */
.loading-section {
    text-align: center;
    padding: 3rem 0;
}

.loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Sección de error */
.error-section {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

.error-section h2 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

#error-message {
    margin-bottom: 1.5rem;
}

/* Pie de página */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Estilos para checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    transform: scale(1.2);
    cursor: pointer;
}

.checkbox-label:hover {
    color: var(--primary-color);
}

/* Responsive design para checkboxes */
@media (min-width: 768px) {
    .checkbox-group {
        flex-direction: row;
        gap: 1.5rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .result-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .result-actions {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .result-score {
        margin-top: 0.5rem;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .search-form,
    .results-section {
        padding: 1.5rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .api-status {
        width: 100%;
        justify-content: center;
    }
}

/* Estilos para el historial de actualizaciones */
.history-link {
    color: var(--secondary-color);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.9em;
}

/* Modal para el historial */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 700px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-speed);
}

.close:hover {
    color: var(--text-color);
}

.update-history-list {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.update-entry {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.update-entry:last-child {
    border-bottom: none;
}

.update-date {
    font-weight: bold;
    color: var(--primary-color);
}

.update-details {
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--text-color);
}

/* Estilos para autenticación */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: var(--card-shadow);
    gap: 8px;
}

.small-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

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