﻿/* 
   لوحة النتائج - scoreboard.css
    */

/*  الحاوية الرئيسية  */
.scoreboard-container {
    position: relative;
    border-radius: 20px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.18);
    border: none;
    background: white;
}

/*  شريط الرأس  */
.scoreboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 0;
    border-bottom: none;
    gap: 12px;
}

.scoreboard-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-align: center;
    letter-spacing: 0.5px;
}

/* أيقونة الإعدادات */
.scoreboard-settings {
    font-size: 18px;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scoreboard-settings:hover {
    color: white;
    transform: rotate(90deg);
    background: rgba(255,255,255,0.28);
}

/* زر التراجع */
.undo-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.undo-button:hover {
    background: rgba(255,255,255,0.32);
    transform: translateY(-1px);
}

/*  حاوية الفريقين  */
.teams-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 20px 16px;
    gap: 0;
    background: #f8f9ff;
}

/*  بطاقة الفريق  */
.team-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 28px;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    border: 2px solid #e8eaf6;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    gap: 6px;
}

/* خط ملون في أعلى البطاقة */
.team-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    transition: background 0.3s ease;
}

#team1-container::before {
    background: linear-gradient(90deg, #ff6b35, #ff5722);
}

#team2-container::before {
    background: linear-gradient(90deg, #42a5f5, #1565c0);
}

.team-container:hover {
    border-color: #c5cae9;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102,126,234,0.15);
}

/* حالة الفريق النشط */
.team-container.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 8px 28px rgba(102,126,234,0.45);
    transform: translateY(-4px) scale(1.02);
}

.team-container.active::before {
    background: rgba(255,255,255,0.3);
}

.team-container.active .team-name,
.team-container.active .team-score {
    color: white !important;
}

/* مؤشر "دورك" للفريق النشط */
.team-container.active::after {
    content: ' دورك';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/*  اسم الفريق  */
.team-name {
    font-size: 17px;
    font-weight: 700;
    color: #424242;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    transition: color 0.3s ease;
    margin-bottom: 4px;
}

/*  حاوية النتيجة  */
.score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/*  النتيجة  */
.team-score {
    font-size: 56px;
    font-weight: 800;
    min-width: 72px;
    text-align: center;
    transition: all 0.3s ease;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

#team1-score { color: #e64a19; }
#team2-score { color: #1565c0; }

.team-container.active .team-score {
    color: white !important;
}

/*  أزرار +/-  */
.score-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.score-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 5px 12px rgba(0,0,0,0.25);
}

.decrease-btn { background: linear-gradient(135deg, #ef5350, #c62828); }
.increase-btn { background: linear-gradient(135deg, #66bb6a, #2e7d32); }

/*  فاصل VS  */
.score-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
    align-self: center;
    margin: 0 8px;
}

/*  أزرار التحكم السفلية  */
.scoreboard-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e8eaf6;
    flex-wrap: wrap;
}

.scoreboard-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 20px;
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(63,81,181,0.2);
}

.scoreboard-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 5px 14px rgba(63,81,181,0.32);
    transform: translateY(-2px);
}

#editScoreBtn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.reset-btn-in-settings {
    background: linear-gradient(135deg, #ef5350, #c62828);
    box-shadow: 0 3px 8px rgba(239,83,80,0.25);
}

.reset-btn-in-settings:hover {
    background: linear-gradient(135deg, #c62828, #ef5350);
    box-shadow: 0 5px 14px rgba(239,83,80,0.38);
}

/*  نافذة إعدادات السكوربورد  */
#scoreboardSettingsModal .settings-panel {
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}

#scoreboardSettingsModal .settings-group {
    border: 1px solid #e8eaf6;
    border-radius: 12px;
    padding: 16px;
    background: #fafbff;
    margin-bottom: 0;
}

#scoreboardSettingsModal .settings-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #c5cae9;
    display: flex;
    align-items: center;
    gap: 7px;
}

#scoreboardSettingsModal .settings-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary-color);
    flex-shrink: 0;
}

#scoreboardSettingsModal .modal-content {
    max-width: 480px !important;
}

/* تنسيق صف تعديل النتيجة */
.score-edit-group {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-bottom: 10px !important;
}

.score-edit-group label {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: var(--text-color) !important;
    flex: 1;
    margin-bottom: 0 !important;
}

.score-edit-group span {
    font-size: 26px !important;
    font-weight: 800 !important;
    min-width: 48px !important;
    text-align: center !important;
    color: var(--primary-color) !important;
}

/*  إعادة التعيين  */
.reset-help-text {
    font-size: 13px;
    color: var(--text-light);
    margin: 0 0 10px;
    line-height: 1.6;
}

/*  صوت  */
.sound-control {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.sound-control:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.sound-on  { color: #a5d6a7; }
.sound-off { color: #ef9a9a; }

/*  أنيميشن تحديث النتيجة  */
@keyframes scorePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.team-score.updated {
    animation: scorePop 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
