
/* إعدادات أساسية */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --gold-color: #f1c40f;
    --silver-color: #95a5a6;
    --bronze-color: #cd7f32;
    --light-bg: #f9f9f9;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    --domain-blue: #0066cc;
    --domain-green: #00a86b;
    --domain-red: #e74c3c;
    --domain-purple: #9b59b6;
    --domain-orange: #f39c12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--light-bg);
    color: var(--secondary-color);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
    position: relative;
}

/* خلفية متحركة للدومينات */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.domain {
    position: absolute;
    font-weight: bold;
    opacity: 0.1;
    font-size: 2rem;
    animation: float 20s infinite linear;
    color: var(--secondary-color);
}

.domain1 {
    top: 10%;
    left: 10%;
    color: var(--domain-blue);
    animation-duration: 25s;
}

.domain2 {
    top: 20%;
    right: 15%;
    color: var(--domain-green);
    animation-duration: 30s;
    animation-delay: 2s;
}

.domain3 {
    top: 60%;
    left: 20%;
    color: var(--domain-red);
    animation-duration: 35s;
    animation-delay: 5s;
}

.domain4 {
    top: 70%;
    right: 10%;
    color: var(--domain-purple);
    animation-duration: 40s;
    animation-delay: 7s;
}

.domain5 {
    top: 40%;
    left: 50%;
    color: var(--domain-orange);
    animation-duration: 45s;
    animation-delay: 10s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* رأس الصفحة */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--domain-blue));
    padding: 30px 20px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    color: white;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-container i {
    font-size: 3rem;
    color: white;
    animation: pulse 2s infinite;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    margin: 10px 0 20px;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.admin-btn-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-btn, .winner-btn {
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn i, .winner-btn i {
    font-size: 1.1rem;
}

.winner-btn {
    background-color: var(--gold-color);
    color: var(--secondary-color);
    border-color: var(--gold-color);
    font-weight: bold;
    position: relative;
}

.winner-btn::after {
    content: "🔒";
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 0.8rem;
    background-color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.admin-btn:hover, .winner-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.admin-btn:hover {
    background-color: white;
    color: var(--primary-color);
}

.winner-btn:hover {
    background-color: white;
    color: var(--gold-color);
}

.winner-btn:hover::after {
    transform: scale(1.1);
}

/* الأقسام الرئيسية */
main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.input-section, .leaderboard-section {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.input-section:hover, .leaderboard-section:hover {
    transform: translateY(-5px);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.section-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

h2 {
    margin: 0;
    color: var(--secondary-color);
    text-align: center;
    font-size: 1.8rem;
}

/* نموذج الإدخال */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

label i {
    color: var(--primary-color);
}

input[type="text"], input[type="number"], input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.submit-btn, #savePrizesBtn, #deleteBtn, #resetBtn, #loginBtn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(to right, var(--primary-color), var(--domain-blue));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover, #savePrizesBtn:hover, #deleteBtn:hover, #resetBtn:hover, #loginBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

#resetBtn {
    background-color: var(--accent-color);
    margin-top: 10px;
}

#resetBtn:hover {
    background-color: #c0392b;
}

/* لوحة المتصدرين */
.search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

#searchInput {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

#searchInput:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
}

.leaderboard::-webkit-scrollbar {
    width: 8px;
}

.leaderboard::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.leaderboard::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leaderboard-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.rank {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 15px;
    width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-info {
    flex-grow: 1;
}

.player-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.player-sales {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.player-sales::before {
    content: "🌐";
    font-size: 0.9rem;
}

.prize {
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 50px;
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    gap: 5px;
}

.prize::before {
    content: "🏆";
    font-size: 0.9rem;
}

/* مراكز المتصدرين */
.first-place {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 2px solid var(--gold-color);
    position: relative;
}

.first-place::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--gold-color), rgba(241, 196, 15, 0.3));
}

.first-place .rank {
    color: var(--gold-color);
    font-size: 1.8rem;
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

.second-place {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border: 2px solid var(--silver-color);
    position: relative;
}

.second-place::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--silver-color), rgba(149, 165, 166, 0.3));
}

.second-place .rank {
    color: var(--silver-color);
    font-size: 1.7rem;
    text-shadow: 0 0 5px rgba(149, 165, 166, 0.5);
}

.third-place {
    background: linear-gradient(135deg, #fbe9e7, #ffccbc);
    border: 2px solid var(--bronze-color);
    position: relative;
}

.third-place::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--bronze-color), rgba(205, 127, 50, 0.3));
}

.third-place .rank {
    color: var(--bronze-color);
    font-size: 1.6rem;
    text-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
}

/* لوحة التحكم */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    box-shadow: var(--hover-shadow);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    left: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: white;
    background-color: var(--accent-color);
    transform: rotate(90deg);
}

.admin-controls {
    margin-top: 20px;
}

.admin-controls h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-controls h3::before {
    content: "⚙️";
}

/* شاشة الفائز */
.winner-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c2461, #1e3799, #40739e);
    z-index: 2000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.winner-content {
    position: relative;
    z-index: 10;
    animation: fadeIn 1s ease-in-out;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

.winner-info {
    margin-bottom: 30px;
}

.medal {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.7));
}

.winner-info h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.winner-details {
    margin-bottom: 30px;
}

.winner-details h2 {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--gold-color);
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.7);
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 15px rgba(241, 196, 15, 0.7);
    }
    to {
        text-shadow: 0 0 25px rgba(241, 196, 15, 1);
    }
}

.winner-details p {
    font-size: 2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.winner-details p::before {
    content: "🌐";
    font-size: 1.8rem;
}

.winner-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gold-color);
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.7);
    margin-top: 20px;
}

#exitWinnerBtn {
    padding: 15px 30px;
    background-color: white;
    color: var(--secondary-color);
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

#exitWinnerBtn::before {
    content: "✖️";
}

#exitWinnerBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

#fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* تأثيرات حركية */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* تنسيقات الرسائل */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: var(--hover-shadow);
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background-color: #2ecc71;
}

.message.error {
    background-color: var(--accent-color);
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    .winner-info h1 {
        font-size: 2rem;
    }

    .winner-details h2 {
        font-size: 3rem;
    }

    .winner-details p {
        font-size: 1.5rem;
    }

    .winner-title {
        font-size: 2rem;
    }

    .message {
        right: 10px;
        left: 10px;
        transform: translateY(-120%);
    }

    .message.show {
        transform: translateY(0);
    }
}
