/**
 * Frontend Styles
 */

.fmp-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

.fmp-header {
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #222;
    border-bottom: 1px solid #eee;
    background: linear-gradient(90deg, #f9f9f9, #fff);
}

.fmp-tabs {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.fmp-tab {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    background: #fff;
    transition: all 0.3s ease;
    font-size: 16px;
}

.fmp-tab:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.fmp-tab.active {
    background: #e41e26;
    color: #fff;
    border-color: #e41e26;
}

.fmp-matches-list {
    padding: 20px;
}

.fmp-match-item {
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.fmp-match-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.fmp-match-item[data-status="live"] {
    border-right: 4px solid #e41e26;
}

.fmp-match-item[data-status="upcoming"] {
    border-right: 4px solid #2ecc71;
}

.fmp-match-item[data-status="finished"] {
    border-right: 4px solid #777;
    opacity: 0.9;
}

.fmp-match-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fmp-match-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    gap: 20px;
}

.fmp-team {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.fmp-team-right {
    justify-content: flex-start;
}

.fmp-team-left {
    justify-content: flex-end;
}

.fmp-team-logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fmp-team-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fmp-logo-placeholder {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: bold;
    font-size: 20px;
}

.fmp-team-name {
    font-size: 18px;
    font-weight: bold;
    color: #222;
}

.fmp-match-center {
    text-align: center;
    min-width: 180px;
}

.fmp-timezone {
    font-size: 13px;
    color: #e41e26;
    margin-bottom: 5px;
    font-weight: bold;
}

.fmp-score-box {
    font-size: 32px;
    font-weight: bold;
    color: #222;
    margin: 5px 0;
}

.fmp-time {
    font-size: 16px;
    color: #777;
    margin-bottom: 8px;
}

.fmp-status {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}

.fmp-status-live {
    background: #e41e26;
}

.fmp-status-upcoming {
    background: #2ecc71;
}

.fmp-status-finished {
    background: #777;
}

.fmp-countdown {
    margin-top: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #2ecc71;
}

.fmp-countdown-near {
    color: #e41e26;
}

.fmp-match-footer {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.fmp-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fmp-detail-icon {
    font-size: 14px;
}

.fmp-detail-link {
    color: #e41e26;
    font-weight: bold;
    margin-right: auto;
}

.fmp-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.fmp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e41e26;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fmp-no-matches {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.fmp-no-matches-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.fmp-no-matches-text {
    font-size: 18px;
}

/* ========== تحسينات قوية للهواتف ========== */

/* للهواتف المتوسطة (شاشات حتى 768px) */
@media screen and (max-width: 768px) {
    .fmp-match-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 8px;
        gap: 5px;
    }
    
    .fmp-team {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        flex: 0 0 auto;
        width: 70px;
    }
    
    .fmp-team-right {
        order: 1;
    }
    
    .fmp-team-left {
        order: 3;
    }
    
    .fmp-team-logo {
        width: 45px;
        height: 45px;
    }
    
    .fmp-logo-placeholder {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .fmp-team-name {
        font-size: 12px;
        text-align: center;
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .fmp-match-center {
        order: 2;
        flex: 1;
        min-width: 90px;
        padding: 0 3px;
    }
    
    .fmp-timezone {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .fmp-score-box {
        font-size: 20px;
        margin: 2px 0;
    }
    
    .fmp-time {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .fmp-status {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .fmp-countdown {
        font-size: 9px;
        margin-top: 2px;
    }
    
    .fmp-match-footer {
        padding: 8px 10px;
        gap: 8px;
        font-size: 11px;
    }
    
    .fmp-detail {
        font-size: 11px;
    }
}

/* للهواتف الصغيرة (شاشات حتى 480px) */
@media screen and (max-width: 480px) {
    .fmp-header {
        padding: 12px;
        font-size: 18px;
    }
    
    .fmp-tabs {
        padding: 10px;
        gap: 5px;
    }
    
    .fmp-tab {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .fmp-match-content {
        padding: 8px 5px;
    }
    
    .fmp-team {
        width: 60px;
    }
    
    .fmp-team-logo {
        width: 40px;
        height: 40px;
    }
    
    .fmp-logo-placeholder {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .fmp-team-name {
        font-size: 10px;
        max-width: 60px;
    }
    
    .fmp-match-center {
        min-width: 80px;
    }
    
    .fmp-timezone {
        font-size: 8px;
    }
    
    .fmp-score-box {
        font-size: 18px;
    }
    
    .fmp-time {
        font-size: 10px;
    }
    
    .fmp-status {
        padding: 2px 5px;
        font-size: 8px;
    }
    
    .fmp-countdown {
        font-size: 8px;
    }
    
    .fmp-match-footer {
        padding: 6px 8px;
        gap: 5px;
        font-size: 9px;
    }
    
    .fmp-detail {
        font-size: 9px;
    }
    
    .fmp-detail-icon {
        font-size: 10px;
    }
}

/* للهواتف الصغيرة جداً (شاشات حتى 360px) */
@media screen and (max-width: 360px) {
    .fmp-team {
        width: 50px;
    }
    
    .fmp-team-logo {
        width: 35px;
        height: 35px;
    }
    
    .fmp-logo-placeholder {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .fmp-team-name {
        font-size: 9px;
        max-width: 50px;
    }
    
    .fmp-match-center {
        min-width: 70px;
    }
    
    .fmp-score-box {
        font-size: 16px;
    }
    
    .fmp-time {
        font-size: 9px;
    }
}