/* Moodle Log Processing Application Styles */

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

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

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

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
main {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

h3 {
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.info, .section-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background-color: #e8f4f8;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

/* Forms */
.filter-form {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

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

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button, .button {
    padding: 0.5rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover, .button:hover {
    background-color: #2980b9;
}

.button {
    background-color: #95a5a6;
}

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

/* Tables */
.discovery-section {
    margin-bottom: 3rem;
}

.discovery-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
}

.discovery-table thead {
    background-color: #34495e;
    color: white;
}

.discovery-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.discovery-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.discovery-table tbody tr:hover {
    background-color: #f8f9fa;
}

.discovery-table tbody tr:last-child td {
    border-bottom: none;
}

.example-data {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.matrix-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.matrix-table {
    margin-top: 0;
}

.matrix-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* No Data */
.no-data {
    padding: 2rem;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Action Section */
.action-section {
    background-color: #e8f4f8;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: center;
    border-left: 4px solid #3498db;
}

.action-section h3 {
    margin-top: 0;
    color: #2c3e50;
}

.action-section p {
    margin-bottom: 1rem;
    color: #555;
}

/* Session Info */
.session-info,
.rules-info,
.processing-actions,
.results-status {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table th {
    text-align: left;
    padding: 0.75rem;
    width: 200px;
    color: #555;
    font-weight: 600;
}

.info-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.info-table td small {
    display: block;
    color: #999;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.rule-group h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.rule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-list li {
    padding: 0.5rem;
    background-color: white;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.processing-actions ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.processing-actions li {
    margin-bottom: 0.5rem;
}

.results-status {
    background-color: #e8f5e9;
    border-left: 4px solid #27ae60;
}

.success-message {
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
}

footer p {
    font-size: 0.9rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.message-success {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.message-error {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.message-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* Upload Form */
.upload-form {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.upload-form .form-group {
    margin-bottom: 1rem;
}

.upload-form input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.upload-form small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.9rem;
}

.upload-info {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.upload-info ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.upload-info li {
    margin-bottom: 0.5rem;
}

/* Rules Selection Form */
.rules-form {
    margin-top: 2rem;
}

.form-section {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.required {
    color: #e74c3c;
}

.filter-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #e8f4f8;
    border-radius: 4px;
}

.filter-badge {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.selection-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ddd;
}

.module-type-filters {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
}

.module-type-filters h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-size: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-type-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.filter-type-button:hover {
    background-color: #2980b9;
}

.button-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    background-color: #95a5a6;
}

.button-small:hover {
    background-color: #7f8c8d;
}

.selection-count {
    margin-left: auto;
    font-weight: 600;
    color: #2c3e50;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-label:hover {
    border-color: #3498db;
    background-color: #f0f8ff;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text {
    flex: 1;
    padding-right: 0.4rem; /* Space for info button */
}

.checkbox-text strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.checkbox-text small {
    display: block;
    color: #666;
    font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text strong {
    color: #27ae60;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: #27ae60;
    background-color: #e8f5e9;
}

/* Event description styles */
.event-item {
    display: flex;
    flex-direction: column;
}

.event-label {
    position: relative;
}

.info-button {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: transparent;
    color: #ccc;
    border: none;
    width: auto;
    height: auto;
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
    display: inline;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
    flex-shrink: 0;
    z-index: 10;
    opacity: 0.3;
    font-weight: normal;
}

.info-button:hover {
    color: #3498db;
    opacity: 0.8;
}

.event-description {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-left: 3px solid #3498db;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: slideDown 0.2s ease-out;
}

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

.event-description-content {
    color: #555;
}

.event-description-content strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.5rem;
}

.event-description-content p {
    margin: 0;
}

.completion-hint {
    display: block;
    margin-top: 0.25rem;
    color: #27ae60;
    font-weight: 600;
    font-size: 0.85rem;
}

.engagement-hint {
    display: block;
    margin-top: 0.25rem;
    color: #3498db;
    font-weight: 600;
    font-size: 0.85rem;
}

.completed-yes {
    color: #27ae60;
    font-weight: 600;
}

.completed-no {
    color: #e74c3c;
    font-weight: 600;
}

.user-summary-row {
    border-top: 2px solid #3498db;
    border-bottom: 1px solid #bdc3c7;
}

.number {
    text-align: right;
}

.recommended-events-info {
    background-color: #e8f5e9;
    border-left: 4px solid #27ae60;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.recommended-events-info h4 {
    margin-top: 0;
    color: #27ae60;
    margin-bottom: 0.5rem;
}

.recommended-events-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.recommended-events-info li {
    margin-bottom: 0.5rem;
}

.recommended-events-info small {
    color: #666;
    font-style: italic;
}

.recommended-event {
    background-color: #f0f9f0;
    border-left: 3px solid #27ae60;
}

.recommended-event .checkbox-text strong::after {
    content: " (Recomendado)";
    color: #27ae60;
    font-size: 0.85em;
    font-weight: normal;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #ddd;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.button-primary {
    background-color: #27ae60;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.button-primary:hover {
    background-color: #229954;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav {
        display: flex;
        gap: 0.5rem;
    }
    
    nav a {
        margin-left: 0;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .discovery-table {
        font-size: 0.9rem;
    }
    
    .discovery-table th,
    .discovery-table td {
        padding: 0.5rem;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .selection-controls {
        flex-wrap: wrap;
    }
    
    .selection-count {
        margin-left: 0;
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button,
    .form-actions .button {
        width: 100%;
    }
    
    .report-table {
        font-size: 0.85rem;
    }
    
    .report-table th,
    .report-table td {
        padding: 0.5rem;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-buttons .button {
        width: 100%;
    }
}
