/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #4682B4 50%, #1E90FF 100%);
    min-height: 100vh;
    direction: rtl;
    color: #333;
}

/* الصفحات */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* صفحة التسجيل */
.registration-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-3d {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, #87CEEB, #4682B4, #1E90FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    transform: perspective(500px) rotateX(15deg);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: perspective(500px) rotateX(15deg) translateY(0px); }
    50% { transform: perspective(500px) rotateX(15deg) translateY(-10px); }
}

.logo-container h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.registration-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
}

.registration-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4682B4;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #87CEEB;
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #87CEEB, #4682B4);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(70, 130, 180, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

.login-link {
    text-align: center;
    margin-top: 20px;
}

.login-link a {
    color: #4682B4;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* لوحة التحكم */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.header .logo-3d {
    font-size: 2rem;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.play-timer {
    background: linear-gradient(45deg, #87CEEB, #4682B4);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 0;
    backdrop-filter: blur(10px);
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-link {
    display: block;
    padding: 15px 25px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(90deg, rgba(135, 206, 235, 0.1), transparent);
    color: #4682B4;
    border-right-color: #87CEEB;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-section h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* إحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: #4682B4;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #87CEEB;
    margin: 0;
}

/* الألعاب */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.game-logo {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    margin-bottom: 15px;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.game-card h3 {
    color: #4682B4;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.game-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.game-card .btn-primary {
    width: auto;
    padding: 12px 25px;
    font-size: 14px;
}

/* منطقة اللعب */
.game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.game-header h3 {
    color: #4682B4;
    font-size: 1.5rem;
}

.game-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.game-content {
    height: 600px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.game-content iframe {
    border-radius: 15px;
}

/* Popup الترحيب */
.popup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-box {
    background-color: #fff5e0;
    padding: 25px;
    border: 2px solid #ffcc66;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    text-align: right;
}

.popup-box h2 {
    color: #e67e22;
    margin-top: 0;
}

.popup-box ul {
    padding-right: 20px;
    line-height: 1.8;
}

.popup-box p {
    margin-top: 15px;
}

.close-btn {
    margin-top: 20px;
    background-color: #e67e22;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    float: left;
}

/* الإعلانات */
.interstitial-ad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.ad-header h3 {
    color: #4682B4;
    margin-bottom: 10px;
}

.ad-placeholder {
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    border-radius: 15px;
    padding: 40px;
    margin: 20px 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ad-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ad-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ad-footer {
    margin-top: 20px;
}

.ad-note {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

/* إشعار المكافأة */
.reward-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #87CEEB, #4682B4);
    color: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    z-index: 10001;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    animation: rewardPop 0.5s ease-out;
}

@keyframes rewardPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.reward-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.reward-content h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.reward-content p {
    margin-bottom: 15px;
}

.reward-content .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    width: auto;
    padding: 10px 25px;
}

/* تحذير عدم النشاط */
.inactivity-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    z-index: 10002;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    animation: warningShake 0.5s ease-out;
}

@keyframes warningShake {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-52%, -50%); }
    75% { transform: translate(-48%, -50%); }
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: warningBlink 1s infinite;
}

@keyframes warningBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.warning-content h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.warning-content p {
    margin-bottom: 15px;
}

.warning-content .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    width: auto;
    padding: 10px 25px;
}

/* معلومات الحساب */
.account-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.info-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.info-card h3 {
    color: #4682B4;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.info-card p {
    margin-bottom: 10px;
    color: #555;
}

/* السحب */
.withdraw-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.withdraw-form {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.withdraw-status {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.withdraw-requests {
    margin-top: 20px;
}

/* الإحالة */
.referral-container {
    display: grid;
    gap: 25px;
}

.referral-code-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.referral-code {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.referral-code input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #4682B4;
}

.referral-stats {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.referred-users {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.referred-users-list {
    margin-top: 20px;
}

/* التجاوب */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        order: 1;
        padding: 20px;
    }
    
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .withdraw-container {
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .popup-box {
        margin: 20px;
        padding: 20px;
    }
    
    .logo-3d {
        font-size: 3rem;
    }
    
    .registration-form {
        padding: 30px 25px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .game-content {
        height: 400px;
    }
    
    .logo-3d {
        font-size: 2.5rem;
    }
    
    .registration-form {
        padding: 25px 20px;
    }
}

