/* Tweak: Improve contrast & visibility of mode buttons */
.master-tabs .hub-btn {
    color: #ffffff !important;
    transition: all 0.3s ease;
}
.master-tabs .hub-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}
@font-face {
    font-family: 'Hiwar';
    src: url('../Hiwar-Bold.otf') format('opentype');
}
@font-face {
    font-family: 'beIN';
    src: url('https://storagebeincom-b4dvftgkaebcayar.z01.azurefd.net/mena/fonts/ar/beINNewArabicFont2017-Bold.woff') format('woff');
    font-weight: bold;
}
@font-face {
    font-family: 'beIN';
    src: url('https://storagebeincom-b4dvftgkaebcayar.z01.azurefd.net/mena/fonts/ar/beINNewArabicFont2017-DemiBold.woff') format('woff');
    font-weight: 600;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    direction: rtl;
}

#hub-header, #hub-footer {
    direction: ltr;
}

.wc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3 { font-family: 'Hiwar', sans-serif; }

.main-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.motion-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 950px) {
    .motion-grid { grid-template-columns: 1fr; }
}

.preview-area {
    background: #0a0a0b;
    border-radius: var(--radius-lg);
    border: 1px solid #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

#sourceCanvas, #videoResult {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

#progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(10px);
    direction: ltr;
}

.group-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.group-table th, .group-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.group-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
}

.group-table td.team-name {
    text-align: right;
    font-family: 'Hiwar', sans-serif;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flag-img {
    width: 32px;
    height: 22px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 8px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Hiwar', sans-serif;
    font-size: 1.1rem;
    white-space: nowrap;
    transition: 0.2s;
}

.tab-btn.active, .tab-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    border-color: transparent;
}

.edit-input {
    width: 45px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 6px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.edit-input:focus {
    outline: none;
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.bg-upload-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border);
    color: var(--text-dim);
    padding: 1.5rem;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: 0.3s;
}
.bg-upload-btn:hover {
    border-color: #a855f7;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.05);
}

.hub-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

/* Spinner */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.pts-col { font-weight: 800; color: #a855f7; }
