/* Copyright (c) 2025. Jericho Crosby (Chalwk) */

:root {
    --primary: #4a6fa5;
    --secondary: #6b8cbc;
    --accent: #ff9e44;
    --light: #f5f7fa;
    --dark: #2c3e50;
    --text: #333;
    --text-light: #666;
    --border: #e1e5eb;
    --success: #2ecc71;
    --warning: #e67e22;
    --danger: #e74c3c;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--light);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

h1 {
    color: var(--primary);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.search-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

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

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

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

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

select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: white;
}

.log-section {
    margin-bottom: 40px;
}

.log-title {
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.log-table th {
    background-color: var(--primary);
    color: white;
    padding: 12px 15px;
    text-align: left;
}

.log-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

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

.log-table tr:hover {
    background-color: rgba(74, 111, 165, 0.05);
}

.type-1, .type-2 {
    background-color: rgba(231, 76, 60, 0.1);
}

.type-3 {
    background-color: rgba(46, 204, 113, 0.1);
}

.type-4, .type-5, .type-6 {
    background-color: rgba(230, 126, 34, 0.1);
}

.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.type-1 .type-badge, .type-2 .type-badge {
    background-color: var(--danger);
    color: white;
}

.type-3 .type-badge {
    background-color: var(--success);
    color: white;
}

.type-4 .type-badge, .type-5 .type-badge, .type-6 .type-badge {
    background-color: var(--warning);
    color: white;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

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

.delete-btn {
    background-color: var(--danger);
    color: white;
}

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

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    color: var(--primary);
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

.prediction-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.prediction-title {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prediction-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.prediction-card {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border-radius: 8px;
    background-color: var(--light);
}

.prediction-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.prediction-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prediction-highlight {
    background-color: rgba(255, 158, 68, 0.2);
    border-left: 4px solid var(--accent);
}

.stats-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    padding: 15px;
    border-radius: 8px;
    background-color: var(--light);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.legend-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.legend-colour {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

.legend-colour.danger {
    background-color: var(--danger);
}

.legend-colour.success {
    background-color: var(--success);
}

.legend-colour.warning {
    background-color: var(--warning);
}

.multiple-entry-controls {
    margin-top: 10px;
}

.time-type-pair {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.time-type-pair .form-control {
    flex: 1;
}

.remove-pair-btn {
    background-color: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
}

.add-pair-btn {
    background-color: var(--success);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    margin-top: 5px;
}

.type-combination-option {
    font-weight: normal;
}

.action-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.btn-secondary:hover {
    background-color: var(--text);
}

#importExportModal .modal-content {
    max-width: 400px;
}

#importExportModal .form-group {
    margin-bottom: 20px;
}

#importExportModal p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.prediction-value {
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.probability-bars {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    height: 6px;
}

.probability-bar {
    flex: 1;
    background-color: var(--border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.probability-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 3px;
    transition: height 0.5s ease;
}

.probability-fill.high {
    background-color: var(--success);
}

.probability-fill.medium {
    background-color: var(--warning);
}

.probability-fill.low {
    background-color: var(--danger);
}

.pattern-indicator {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--primary);
    margin-top: 5px;
    display: inline-block;
}

.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    margin-left: 5px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

.trend-stable {
    color: var(--text-light);
}

.btn-analytics {
    background-color: var(--secondary);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-analytics:hover {
    background-color: var(--primary);
}

.analytics-modal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.analytics-card {
    background-color: var(--light);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.analytics-card h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.day-of-week-chart {
    display: flex;
    align-items: flex-end;
    height: 100px;
    gap: 5px;
    margin-top: 10px;
}

.day-bar {
    flex: 1;
    background-color: var(--secondary);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 1px;
}

.day-bar.highlight {
    background-color: var(--accent);
}

.day-label {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
}

.time-of-day-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 10px;
}

.hour-cell {
    width: calc(100% / 12);
    height: 20px;
    background-color: var(--border);
    border-radius: 2px;
    position: relative;
}

.hour-cell.active {
    background-color: var(--primary);
}

.hour-cell.peak {
    background-color: var(--accent);
    box-shadow: 0 0 0 1px white;
}

.event-timestamp {
    font-size: 0.85rem;
    color: var(--text-light);
}

.event-type-detail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card.small {
    padding: 10px;
}

.stat-card.small .stat-value {
    font-size: 1.2rem;
}

.stat-card.small .stat-label {
    font-size: 0.8rem;
}

.confidence-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 5px;
}

.confidence-high {
    background-color: var(--success);
}

.confidence-medium {
    background-color: var(--warning);
}

.confidence-low {
    background-color: var(--danger);
}

.detailed-stats {
    display: contents;
}

.prediction-probability {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
}

.prediction-pattern {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 5px;
}

.warning-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    padding: 5px;
    background-color: #fdf2f2;
    border-radius: 3px;
    border-left: 3px solid #e74c3c;
}

/* Sample Data Notification */
.sample-data-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: slideIn 0.5s ease-out;
    display: none;
}

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

.notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
}

.notification-text strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

.notification-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.notification-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

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

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

/* Responsive adjustments for notification */
@media (max-width: 768px) {
    .notification-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .notification-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    .filter-controls {
        width: 100%;
        justify-content: space-between;
    }

    .log-table {
        font-size: 0.9rem;
    }

    .log-table th,
    .log-table td {
        padding: 8px 10px;
    }

    .prediction-content {
        flex-direction: column;
    }

    .time-type-pair {
        flex-direction: column;
        align-items: stretch;
    }

    .action-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }

    .action-controls .btn {
        flex: 1;
        min-width: 120px;
    }

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

    .prediction-content {
        flex-direction: column;
    }

    .probability-bars {
        height: 8px;
    }
}