/**
 * Kora Live Theme - Fixes CSS
 * ملف إصلاح الأخطاء والتحسينات
 */

/* ==================================================
   إصلاحات أساسية
   ================================================== */

/* إصلاح اتجاه النص */
body {
    font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif;
    direction: rtl;
    text-align: right;
}

/* إصلاح المباريات المباشرة */
.live-match {
    border: 2px solid #f44336;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    background: rgba(244, 67, 54, 0.1);
    backdrop-filter: blur(10px);
}

/* إصلاح عناصر المباريات */
.match-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color, #4CAF50);
}

/* إصلاح جداول النماذج */
.form-table th {
    text-align: right;
    padding: 1rem 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-table td {
    padding: 1rem 0.5rem;
}

.form-table input,
.form-table select,
.form-table textarea {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-table input:focus,
.form-table select:focus,
.form-table textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* ==================================================
   إصلاحات التجاوب
   ================================================== */

/* إصلاح العرض على الهواتف */
@media (max-width: 768px) {
    .live-match {
        padding: 0.8rem;
        margin: 0.3rem 0;
    }
    
    .match-item {
        padding: 0.8rem;
    }
    
    .form-table {
        width: 100%;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .form-table th {
        font-weight: bold;
        margin-bottom: 0.3rem;
    }
    
    .form-table input,
    .form-table select,
    .form-table textarea {
        max-width: 100%;
    }
}

/* ==================================================
   إصلاحات الأداء
   ================================================== */

/* تحسين الرسوم المتحركة */
.live-match,
.match-item {
    will-change: transform, background-color;
}

/* تحسين التمرير */
* {
    scroll-behavior: smooth;
}

/* إصلاح مشاكل الخطوط */
input, select, textarea, button {
    font-family: inherit;
}

/* ==================================================
   إصلاحات إضافية
   ================================================== */

/* إصلاح مشكلة الفيض */
.match-item,
.live-match {
    overflow: hidden;
    word-wrap: break-word;
}

/* إصلاح مشكلة التركيز */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* إصلاح مشكلة الألوان في الوضع المظلم */
@media (prefers-color-scheme: dark) {
    .form-table th {
        color: #fff;
    }
    
    .form-table input,
    .form-table select,
    .form-table textarea {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    .form-table input::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }
}

/* إصلاح مشكلة الطباعة */
@media print {
    .live-match,
    .match-item {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
    }
    
    .form-table {
        display: none;
    }
}

/* ==================================================
   إصلاحات الوصولية
   ================================================== */

/* تحسين التباين */
.live-match {
    border-width: 2px;
    border-style: solid;
}

/* تحسين حجم النقر */
button,
input[type="submit"],
input[type="button"],
.btn {
    min-height: 44px;
    min-width: 44px;
}

/* إخفاء العناصر للقارئات الصوتية فقط */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================================================
   إصلاحات متقدمة
   ================================================== */

/* إصلاح مشكلة التحميل */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4CAF50;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* إصلاح مشكلة الأخطاء */
.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.success {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.warning {
    color: #FF9800;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid #FF9800;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

/* ==================================================
   أنماط الهيدر والتنقل
   ================================================== */

.header {
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.header.header-hidden {
    transform: translateY(-100%);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 120px;
    height: 40px;
    background: linear-gradient(45deg, var(--primary-color, #4CAF50), #45a049);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover, 
.nav-menu a.active {
    background: var(--primary-color, #4CAF50);
    color: #fff;
    transform: translateY(-2px);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.mobile-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-content {
    margin-top: 80px;
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* ==================================================
   أنماط الفوتر
   ================================================== */

.footer {
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem 0;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-color, #4CAF50);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.2rem 0;
    display: inline-block;
}

.footer-section ul li a:hover {
    color: var(--primary-color, #4CAF50);
    transform: translateX(-5px);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 0.5rem;
}

.footer-menu a {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.2rem 0;
    display: inline-block;
}

.footer-menu a:hover {
    color: var(--primary-color, #4CAF50);
    transform: translateX(-5px);
}

.footer .container > div:last-child {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    color: #999;
    text-align: center;
    font-size: 0.9rem;
}

/* ==================================================
   تجاوب الهيدر والفوتر
   ================================================== */

@media (max-width: 768px) {
    .header {
        padding: 0.8rem 0;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-img {
        width: 100px;
        height: 35px;
        font-size: 12px;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        background: rgba(0, 0, 0, 0.9);
        padding: 1rem;
        border-radius: 10px;
        margin-top: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu a {
        padding: 0.8rem 1rem;
        text-align: center;
        border-radius: 8px;
    }
    
    .mobile-menu {
        display: block;
        position: absolute;
        top: 50%;
        left: 1rem;
        transform: translateY(-50%);
    }
    
    .main-content {
        margin-top: 120px;
        padding: 1rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .logo-img {
        width: 80px;
        height: 30px;
        font-size: 10px;
    }
    
    .nav-menu a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .main-content {
        margin-top: 100px;
    }
    
    .footer {
        padding: 1.5rem 0;
    }
}
