/* FlashLive Football - Frontend Styles */
/* Modern LiveScore-inspired design */

:root {
    --flf-primary: #00a859;
    --flf-primary-dark: #008a47;
    --flf-secondary: #0066cc;
    --flf-bg: #f5f5f5;
    --flf-card-bg: #ffffff;
    --flf-border: #e0e0e0;
    --flf-text: #2c3e50;
    --flf-text-muted: #7f8c8d;
    --flf-live: #e74c3c;
    --flf-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Notice Messages */
.flf-notice {
    padding: 15px 20px;
    margin: 0 0 20px 0;
    border-radius: 6px;
    border-left: 4px solid;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.flf-notice-error {
    border-left-color: #dc3232;
    background: #fef7f7;
    color: #721c24;
}

.flf-notice-warning {
    border-left-color: #ffb900;
    background: #fffbf0;
    color: #856404;
}

.flf-notice a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Main Panel Layout */
.flf-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: var(--flf-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.flf-app-header {
    background: var(--flf-card-bg);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--flf-shadow);
}

.flf-app-content {
    background: var(--flf-card-bg);
    border-radius: 8px;
    padding: 30px;
    min-height: 600px;
    box-shadow: var(--flf-shadow);
}

/* View Headers */
.flf-view-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--flf-border);
}

.flf-view-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: var(--flf-text);
    font-weight: 600;
}

.flf-view-subtitle {
    margin: 0;
    color: var(--flf-text-muted);
    font-size: 15px;
}

/* LEVEL 1: Countries Grid */
.flf-countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.flf-country-card {
    background: #fafafa;
    border: 2px solid var(--flf-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.flf-country-card:hover {
    border-color: var(--flf-primary);
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,168,89,0.15);
}

.flf-country-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--flf-text);
    margin-bottom: 10px;
}

.flf-country-action {
    font-size: 14px;
    color: var(--flf-primary);
    font-weight: 500;
}

/* LEVEL 2: Tournaments List */
.flf-tournaments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flf-tournament-card {
    background: #fafafa;
    border: 2px solid var(--flf-border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.flf-tournament-card:hover {
    border-color: var(--flf-primary);
    background: white;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,168,89,0.15);
}

.flf-tournament-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flf-tournament-icon {
    font-size: 24px;
}

.flf-tournament-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--flf-text);
}

.flf-tournament-meta {
    font-size: 13px;
    color: var(--flf-text-muted);
    margin-top: 2px;
}

.flf-tournament-action {
    color: var(--flf-primary);
    font-weight: 500;
    font-size: 14px;
}

/* LEVEL 3: Matches */
.flf-match-filters {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.flf-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--flf-border);
    background: white;
    color: var(--flf-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.flf-filter-btn:hover {
    border-color: var(--flf-primary);
    color: var(--flf-primary);
}

.flf-filter-btn.active {
    background: var(--flf-primary);
    color: white;
    border-color: var(--flf-primary);
}

.flf-matches-container {
    margin-top: 20px;
}

.flf-date-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--flf-text);
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 20px 0 12px 0;
}

.flf-match-card {
    background: white;
    border: 1px solid var(--flf-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.flf-match-card:hover {
    border-color: var(--flf-primary);
    box-shadow: 0 2px 8px rgba(0,168,89,0.15);
    transform: translateX(5px);
}

.flf-match-card.live {
    background: #fff8f0;
    border-color: var(--flf-live);
    border-width: 2px;
}

.flf-match-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--flf-text-muted);
    min-width: 50px;
}

.flf-match-card.live .flf-match-time {
    color: var(--flf-live);
}

.flf-match-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.flf-match-team {
    font-size: 15px;
    font-weight: 500;
    color: var(--flf-text);
}

.flf-match-team.home {
    text-align: right;
}

.flf-match-team.away {
    text-align: left;
}

.flf-match-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--flf-text);
    text-align: center;
    min-width: 60px;
}

.flf-match-card.live .flf-match-score {
    color: var(--flf-live);
}

.flf-live-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--flf-live);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

/* LEVEL 4: Match Details */
.flf-match-details {
    max-width: 900px;
    margin: 0 auto;
}

.flf-match-header-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    margin-bottom: 30px;
}

.flf-team-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.flf-team-large:hover {
    background: rgba(0,168,89,0.05);
}

.flf-team-large.home .flf-team-name,
.flf-team-large.home .flf-team-score {
    order: 1;
}

.flf-team-large.away .flf-team-score {
    order: 1;
}

.flf-team-large.away .flf-team-name {
    order: 2;
}

.flf-team-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--flf-text);
}

.flf-team-score {
    font-size: 48px;
    font-weight: 700;
    color: var(--flf-text);
}

.flf-match-separator {
    font-size: 32px;
    color: var(--flf-text-muted);
    font-weight: 300;
}

.flf-match-tabs {
    display: flex;
    gap: 2px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.flf-tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--flf-text);
    transition: all 0.2s;
}

.flf-tab-btn:hover {
    background: rgba(0,168,89,0.1);
}

.flf-tab-btn.active {
    background: white;
    color: var(--flf-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.flf-match-content-tabs {
    background: white;
    border-radius: 8px;
    padding: 30px;
}

.flf-tab-content {
    display: none;
}

.flf-tab-content.active {
    display: block;
}

/* Error Message */
.flf-error-message {
    text-align: center;
    padding: 60px 20px;
}

.flf-error-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 20px;
}

.flf-error-message p {
    font-size: 16px;
    color: var(--flf-text-muted);
    margin: 0;
}

/* Sidebars */
.flf-sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flf-left {
    order: 1;
}

.flf-center {
    flex: 1;
    order: 2;
    min-width: 0;
}

.flf-right {
    order: 3;
}

/* Sections */
.flf-section {
    background: var(--flf-card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--flf-shadow);
}

.flf-section-title {
    margin: 0;
    padding: 15px 18px;
    font-size: 14px;
    font-weight: 600;
    background: #fafafa;
    border-bottom: 1px solid var(--flf-border);
    color: var(--flf-text);
}

/* Search Box */
.flf-search-box {
    background: var(--flf-card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--flf-shadow);
}

.flf-search-input-wrapper {
    position: relative;
    padding: 12px;
}

.flf-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

.flf-search-input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--flf-border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.flf-search-input-wrapper input:focus {
    outline: none;
    border-color: var(--flf-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.1);
}

/* Search Results */
.flf-search-results {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid var(--flf-border);
}

.flf-search-result-item {
    padding: 12px 18px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.flf-search-result-item:hover {
    background: #f9f9f9;
}

.flf-search-result-item:last-child {
    border-bottom: none;
}

/* Lists */
.flf-list {
    max-height: 500px;
    overflow-y: auto;
}

.flf-list-item {
    padding: 12px 18px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flf-list-item:hover {
    background: #f9f9f9;
    padding-left: 22px;
}

.flf-list-item:last-child {
    border-bottom: none;
}

.flf-list-item.active {
    background: #e8f5e9;
    border-left: 3px solid var(--flf-primary);
}

.flf-country-name {
    font-weight: 500;
    color: var(--flf-text);
}

.flf-league-name {
    font-weight: 500;
    color: var(--flf-text);
    display: block;
}

.flf-league-country {
    font-size: 12px;
    color: var(--flf-text-muted);
    margin-top: 2px;
    display: block;
}

/* Top Bar */
.flf-topbar {
    background: var(--flf-card-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--flf-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.flf-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flf-tab {
    padding: 10px 20px;
    border: 1px solid var(--flf-border);
    background: white;
    color: var(--flf-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flf-tab:hover {
    border-color: var(--flf-primary);
    color: var(--flf-primary);
}

.flf-tab.active {
    background: var(--flf-primary);
    color: white;
    border-color: var(--flf-primary);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--flf-live);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.flf-date-input {
    padding: 10px 16px;
    border: 1px solid var(--flf-border);
    border-radius: 6px;
    font-size: 14px;
    min-width: 160px;
}

/* Main Content */
.flf-main-content {
    background: var(--flf-card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--flf-shadow);
}

/* Matches Table */
.flf-matches-table {
    min-height: 400px;
}

.flf-match-row {
    display: grid;
    grid-template-columns: 60px 1fr 80px 1fr 100px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s;
    cursor: pointer;
    gap: 15px;
}

.flf-match-row:hover {
    background: #f9f9f9;
}

.flf-match-row.live {
    background: #fff8f0;
    border-left: 3px solid var(--flf-live);
}

.flf-match-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--flf-text);
    text-align: center;
}

.flf-match-row.live .flf-match-time {
    color: var(--flf-live);
}

.flf-match-team {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.flf-team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.flf-match-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--flf-text);
    text-align: center;
}

.flf-match-row.live .flf-match-score {
    color: var(--flf-live);
}

.flf-match-status {
    font-size: 12px;
    color: var(--flf-text-muted);
    text-align: right;
}

.flf-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.flf-status-live {
    background: #ffe8e5;
    color: var(--flf-live);
}

.flf-status-finished {
    background: #e8f5e9;
    color: #2e7d32;
}

.flf-status-scheduled {
    background: #e3f2fd;
    color: #1976d2;
}

/* Tournament Header */
.flf-tournament-header {
    padding: 12px 20px;
    background: #fafafa;
    font-weight: 600;
    font-size: 13px;
    color: var(--flf-text);
    border-bottom: 1px solid var(--flf-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Featured Box */
.flf-featured-box,
.flf-stats-box {
    padding: 18px;
}

.flf-featured-match {
    text-align: center;
    padding: 20px;
}

.flf-featured-teams {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
}

.flf-featured-team {
    text-align: center;
}

.flf-featured-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.flf-featured-vs {
    font-size: 18px;
    font-weight: 600;
    color: var(--flf-text-muted);
}

/* Stats Box */
.flf-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.flf-stat-item:last-child {
    border-bottom: none;
}

.flf-stat-label {
    color: var(--flf-text-muted);
    font-size: 13px;
}

.flf-stat-value {
    font-weight: 600;
    color: var(--flf-text);
    font-size: 15px;
}

/* Loading States */
.flf-loading,
.flf-loading-center {
    padding: 40px 20px;
    text-align: center;
    color: var(--flf-text-muted);
}

.flf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--flf-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.flf-no-data {
    padding: 40px 20px;
    text-align: center;
    color: var(--flf-text-muted);
    font-size: 14px;
}

/* Scrollbar Styling */
.flf-list::-webkit-scrollbar,
.flf-search-results::-webkit-scrollbar {
    width: 6px;
}

.flf-list::-webkit-scrollbar-track,
.flf-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.flf-list::-webkit-scrollbar-thumb,
.flf-search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.flf-list::-webkit-scrollbar-thumb:hover,
.flf-search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .flf-sidebar {
        flex: 0 0 240px;
    }
}

@media (max-width: 992px) {
    .flf-panel {
        flex-wrap: wrap;
    }
    
    .flf-left {
        flex: 1 1 100%;
        order: 1;
    }
    
    .flf-center {
        flex: 1 1 100%;
        order: 2;
    }
    
    .flf-right {
        flex: 1 1 100%;
        order: 3;
    }
    
    .flf-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .flf-tabs {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .flf-panel {
        padding: 10px;
        gap: 15px;
    }
    
    .flf-match-row {
        grid-template-columns: 50px 1fr 60px 1fr 80px;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .flf-match-team {
        font-size: 13px;
    }
    
    .flf-match-score {
        font-size: 16px;
    }
    
    .flf-tabs {
        gap: 5px;
    }
    
    .flf-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .flf-match-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .flf-match-time,
    .flf-match-status {
        text-align: left;
    }
    
    .flf-match-score {
        text-align: left;
        margin: 5px 0;
    }
}
