/* Football Prediction - Minimalist & Functional Design */

:root {
    --bg-page: #f5f5f5;
    --bg-white: #ffffff;
    --bg-gray: #f9f9f9;
    --text-dark: #2c3e50;
    --text-gray: #7f8c8d;
    --border: #e0e0e0;
    --blue: #3498db;
    --green: #27ae60;
    --red: #e74c3c;
    --yellow: #f39c12;
}

/* Table Styles for Matches */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table thead {
    background: #f9fafb;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

table tbody tr {
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background-color: #f9fafb;
}

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

/* Prediction row styling */
table tbody tr.bg-yellow-50 {
    background-color: #fefce8;
}

table tbody tr.bg-yellow-50:hover {
    background-color: #fef9c3;
}

/* Batch Prediction Modal Styles */
#batchProgressBar {
    transition: width 0.3s ease;
}

#batchLog {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

#batchLog div {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
}

#batchLog div:last-child {
    border-bottom: none;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.last-update {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Buttons */
.btn {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-white);
    color: var(--text-dark);
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--bg-gray);
    border-color: var(--text-gray);
}

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

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

.btn-secondary {
    background: var(--bg-white);
    border: 1px solid var(--border);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue);
}

/* Search Section */
.search-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#searchInput {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
}

#searchInput:focus {
    outline: none;
    border-color: var(--blue);
}

#clearSearch {
    padding: 0.7rem 1rem;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

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

.filter-btn {
    padding: 0.6rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.filter-select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.filter-select:hover {
    border-color: var(--blue);
    background: var(--bg-gray);
}

.filter-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* League Section */
.league-section {
    margin-bottom: 2rem;
}

.league-header {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.league-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Match Card */
.match-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.match-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.match-time {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
    min-width: 50px;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.match-score {
    font-size: 1rem;
    font-weight: 600;
    color: var(--green);
    padding: 0.25rem 0.5rem;
    background: var(--bg-gray);
    border-radius: 3px;
}

.match-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-predict {
    background: var(--blue);
    color: white;
    border: 1px solid var(--blue);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Prediction Modal - Light Theme */
.prediction-modal-content {
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.prediction-modal-wrapper {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
}

.prediction-modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #047857;
}

.prediction-modal-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.prediction-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.2s ease;
}

.prediction-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.prediction-modal-body {
    padding: 2rem;
    background: #f9fafb;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.prediction-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.prediction-loading-text {
    margin-top: 1rem;
    color: var(--text-gray);
    font-size: 1rem;
}

/* Prediction Content */
.prediction-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Match Header */
.prediction-match-header {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .prediction-match-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.prediction-match-info {
    flex: 1;
}

.prediction-match-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.prediction-match-teams {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.prediction-vs {
    color: #6b7280;
    font-weight: 400;
    margin: 0 0.5rem;
}

.prediction-main-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.prediction-best-bet {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.prediction-best-label {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
}

.prediction-best-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.prediction-best-confidence {
    font-size: 0.75rem;
    opacity: 0.85;
}

.prediction-badge-label {
    font-weight: 500;
}

.prediction-badge-value {
    font-weight: 700;
    font-size: 1rem;
}

.prediction-confidence-section {
    width: 100%;
}

@media (min-width: 1024px) {
    .prediction-confidence-section {
        width: 280px;
    }
}

.prediction-confidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.prediction-confidence-value {
    font-weight: 700;
    font-size: 1.125rem;
    color: #10b981;
}

.prediction-confidence-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.prediction-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.prediction-confidence-desc {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Summary Card */
.prediction-summary-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.prediction-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.prediction-summary-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

/* Details Grid */
.prediction-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.prediction-detail-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.prediction-detail-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.prediction-detail-card.selected-best-prediction {
    border: 2px solid #10b981;
    background: #f0fdf4;
}

.select-best-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.prediction-detail-content {
    flex: 1;
    min-width: 0;
}

.prediction-detail-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.prediction-detail-value {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

/* Stats Grid */
.prediction-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .prediction-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.prediction-stat-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
}

.prediction-stat-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.1);
}

.prediction-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.prediction-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
}

/* Form Grid */
.prediction-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .prediction-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.prediction-form-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.prediction-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.prediction-form-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.prediction-form-list-detailed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prediction-form-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.prediction-form-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.prediction-form-score {
    font-weight: 600;
    color: #111827;
    font-size: 0.875rem;
}

.prediction-form-opponent {
    font-size: 0.75rem;
    color: #6b7280;
}

.prediction-form-badge {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
}

.prediction-form-win {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.prediction-form-draw {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.prediction-form-loss {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.prediction-no-data {
    color: #9ca3af;
    font-size: 0.875rem;
    font-style: italic;
    padding: 0.5rem 0;
}

/* H2H Card */
.prediction-h2h-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.prediction-h2h-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.prediction-h2h-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prediction-h2h-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .prediction-h2h-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.prediction-h2h-date {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.prediction-h2h-match {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.prediction-h2h-team {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.prediction-h2h-score {
    background: #3b82f6;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: var(--bg-gray);
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
}

.modal-close:hover {
    background: var(--border);
}

.modal-body {
    color: var(--text-dark);
}

/* Prediction Result */
.prediction-result {
    padding: 1rem;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

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

.prediction-bet {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--blue);
}

.prediction-confidence {
    font-size: 0.95rem;
    color: var(--green);
    font-weight: 600;
}

.prediction-details {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.prediction-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.stat-item {
    background: var(--bg-white);
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-value {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
}

/* Loading */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--blue);
    animation: spin 0.8s linear infinite;
}

.prediction-loading .spinner {
    border: 4px solid #e5e7eb;
    border-top-color: #10b981;
}

/* Loader for buttons */
.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Button loading state */
button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
}

button:active:not(:disabled) {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .match-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .match-teams {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .match-actions {
        width: 100%;
    }

    .btn-predict {
        width: 100%;
    }
}

/* Table Styles for Analysis Page */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

thead {
    background: var(--bg-gray);
    border-bottom: 2px solid var(--border);
}

th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:hover {
    background: var(--bg-gray);
}

.status-correct {
    color: var(--green);
    font-weight: 600;
}

.status-wrong {
    color: var(--red);
    font-weight: 600;
}

.status-pending {
    color: var(--text-gray);
}

.prediction-inline-result {
    animation: slideDown 0.3s ease-out;
    margin-left: 0;
    margin-right: 0;
}

/* Compact mobile styles */
@media (max-width: 640px) {
    .prediction-inline-result {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

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