/**
 * BelPark Forecast Competition - Frontend Styles
 * Professional styling for the competition interface
 */

/* General Wrapper */
.bpfc-competition-wrapper,
.bpfc-leaderboard-wrapper,
.bpfc-profile-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Loading State */
.bpfc-loading {
    text-align: center;
    padding: 40px 20px;
}

.bpfc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: bpfc-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Messages */
.bpfc-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-left: 4px solid;
    border-radius: 4px;
}

.bpfc-message.bpfc-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.bpfc-message.bpfc-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.bpfc-message.bpfc-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Deadline Box */
.bpfc-deadline-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.bpfc-deadline-content {
    text-align: center;
}

.bpfc-deadline-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.bpfc-deadline-time {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.bpfc-countdown {
    font-size: 18px;
    opacity: 0.9;
}

/* Info Box */
.bpfc-info-box {
    background: #fff;
    border: 2px solid #0073aa;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.bpfc-info-box h3 {
    color: #0073aa;
    margin-top: 0;
    font-size: 28px;
}

/* Form Header */
.bpfc-form-header {
    margin-bottom: 30px;
}

.bpfc-form-header h2 {
    margin-bottom: 10px;
    color: #333;
}

.bpfc-week-info {
    font-size: 16px;
    color: #666;
    margin: 5px 0;
}

.bpfc-participants-count {
    font-size: 14px;
    color: #999;
}

/* Forecast Grid */
.bpfc-forecast-grid {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.bpfc-city-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bpfc-city-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.bpfc-city-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

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

.bpfc-day-forecast {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
}

.bpfc-day-label {
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
}

.bpfc-input-group {
    margin-bottom: 8px;
}

.bpfc-input-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.bpfc-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.bpfc-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

/* NWS Comparison */
.bpfc-nws-comparison {
    background: #e8f4f8;
    border: 1px solid #b3d9e6;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
}

.bpfc-nws-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bpfc-nws-label {
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.bpfc-nws-value {
    color: #333;
    font-size: 12px;
    padding: 2px 0;
}

.bpfc-nws-values {
    color: #333;
}

/* Comparison Toggle */
.bpfc-comparison-toggle {
    text-align: center;
    margin: 20px 0;
}

.bpfc-comparison-toggle label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.bpfc-comparison-toggle input[type="checkbox"] {
    margin-right: 8px;
}

/* Form Actions */
.bpfc-form-actions {
    text-align: center;
    margin: 30px 0;
}

.bpfc-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.bpfc-btn-primary {
    background: #0073aa;
    color: white;
}

.bpfc-btn-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.bpfc-btn-secondary {
    background: #6c757d;
    color: white;
}

.bpfc-btn-secondary:hover {
    background: #545b62;
}

.bpfc-btn-large {
    padding: 16px 40px;
    font-size: 18px;
}

.bpfc-warning-text {
    color: #856404;
    margin-top: 15px;
    font-size: 14px;
}

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

.bpfc-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.bpfc-modal-content h3 {
    margin-top: 0;
    color: #333;
}

.bpfc-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

/* Leaderboard */
.bpfc-leaderboard-header {
    margin-bottom: 30px;
}

.bpfc-leaderboard-header h2 {
    margin-bottom: 20px;
}

.bpfc-season-selector,
.bpfc-view-selector {
    margin: 15px 0;
}

.bpfc-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 10px;
}

.bpfc-view-btn {
    padding: 10px 20px;
    border: 1px solid #0073aa;
    background: white;
    color: #0073aa;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.bpfc-view-btn:hover {
    background: #f0f7fa;
}

.bpfc-view-btn.active {
    background: #0073aa;
    color: white;
}

/* Tables */
.bpfc-table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.bpfc-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bpfc-leaderboard-table thead {
    background: #0073aa;
    color: white;
}

.bpfc-leaderboard-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.bpfc-leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.bpfc-leaderboard-table tbody tr:hover {
    background: #f5f5f5;
}

.bpfc-leaderboard-table .bpfc-rank {
    font-weight: bold;
    color: #0073aa;
    width: 60px;
}

.bpfc-loading-row {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Stats Grid */
.bpfc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.bpfc-stat-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.bpfc-stat-card:hover {
    border-color: #0073aa;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bpfc-stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.bpfc-stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.bpfc-stat-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
}

/* Profile Sections */
.bpfc-profile-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
}

.bpfc-profile-section h3 {
    margin-top: 0;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.bpfc-detail-stats {
    margin: 20px 0;
}

.bpfc-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bpfc-stat-row .bpfc-stat-label {
    color: #666;
    font-weight: 600;
}

.bpfc-stat-row .bpfc-stat-value {
    color: #333;
    font-weight: bold;
}

/* Settings Form */
.bpfc-settings-form {
    max-width: 600px;
}

.bpfc-form-group {
    margin-bottom: 25px;
}

.bpfc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.bpfc-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: normal !important;
}

.bpfc-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
}

/* Legend */
.bpfc-legend {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.bpfc-legend h4 {
    margin-top: 0;
    color: #333;
}

.bpfc-legend ul {
    margin: 10px 0;
    padding-left: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bpfc-day-grid {
        grid-template-columns: 1fr;
    }

    .bpfc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bpfc-deadline-time {
        font-size: 18px;
    }

    .bpfc-countdown {
        font-size: 14px;
    }

    .bpfc-btn-large {
        padding: 12px 24px;
        font-size: 16px;
    }

    .bpfc-leaderboard-table {
        font-size: 13px;
    }

    .bpfc-leaderboard-table th,
    .bpfc-leaderboard-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .bpfc-stats-grid {
        grid-template-columns: 1fr;
    }

    .bpfc-stat-card {
        padding: 15px;
    }

    .bpfc-stat-value {
        font-size: 24px;
    }
}
