/* إعادة تعيين الأنماط الأساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* الخلفية المتموجة */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #3b82f6 50%, #1d4ed8 75%, #1e40af 100%);
}

/* خلفية بديلة بتدرجات لونية */
.background.gradient-style {
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
}

/* خلفية بديلة أخرى بتدرجات دائرية */
.background.circular-gradient {
    background: 
        radial-gradient(circle at 30% 20%, #667eea 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, #764ba2 0%, transparent 50%),
        radial-gradient(circle at 20% 70%, #f093fb 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, #4facfe 0%, transparent 50%),
        linear-gradient(45deg, #1e3c72 0%, #2a5298 50%, #1e40af 100%);
}

/* خلفية بديلة بتدرجات متعددة الألوان */
.background.multi-gradient {
    background: 
        linear-gradient(45deg, #667eea 0%, transparent 25%),
        linear-gradient(-45deg, #764ba2 0%, transparent 25%),
        linear-gradient(135deg, #f093fb 0%, transparent 25%),
        linear-gradient(-135deg, #4facfe 0%, transparent 25%),
        linear-gradient(90deg, #1e3c72 0%, #2a5298 50%, #1e40af 100%);
}

.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 50%;
    animation: wave-animation 20s infinite linear;
}

.wave1 {
    top: -50%;
    left: -50%;
    animation-delay: 0s;
}

.wave2 {
    top: -60%;
    right: -60%;
    animation-delay: -7s;
    background: linear-gradient(45deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
}

.wave3 {
    bottom: -50%;
    left: -30%;
    animation-delay: -14s;
    background: linear-gradient(45deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
}

@keyframes wave-animation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* الحاوي الرئيسي */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* البطاقة الزجاجية */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    margin: 20px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

/* رأس الصفحة */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.logo i {
    font-size: 40px;
    color: white;
}

.welcome-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* تم حذف الانيميشن لتجنب تكرار النص */

/* تم دمج الإيموجي مع النص الترحيبي */

/* تم حذف welcomeWave animation */

.welcome-text p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* قسم التحميل */
.download-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.download-option {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.download-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.download-option:hover::before {
    left: 100%;
}

.download-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

.download-option.ios {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(0, 122, 255, 0.1) 100%);
    border-color: rgba(0, 122, 255, 0.3);
}

.download-option.android {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.1) 100%);
    border-color: rgba(76, 175, 80, 0.3);
}

.download-option.external {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: rgba(255, 152, 0, 0.3);
}

.download-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    flex-shrink: 0;
}

.download-option.ios .download-icon {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
}

.download-option.android .download-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

.download-option.external .download-icon {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.download-info {
    flex: 1;
}

.download-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.download-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.download-image {
    flex-shrink: 0;
}

.download-image img {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* البوب أب */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.popup-overlay.show {
    display: flex;
}

.popup-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: popup-animation 0.3s ease-out;
}

@keyframes popup-animation {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.popup-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3c72;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.popup-body p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

.popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Tajawal', sans-serif;
    min-width: 150px;
    justify-content: center;
}

.btn-video {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-contact {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

/* أزرار التحكم في الخلفية */
.background-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bg-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bg-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.bg-btn.active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.bg-btn i {
    transition: transform 0.3s ease;
}

.bg-btn:hover i {
    transform: rotate(15deg);
}

/* إخفاء الموجات عند استخدام الخلفيات البديلة */
.background.gradient-style .wave,
.background.circular-gradient .wave,
.background.multi-gradient .wave {
    display: none;
}

/* بوب أب التحميل المميز */
.download-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.download-popup-overlay.show {
    display: flex;
}

.download-popup-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.download-popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, #8BC34A, #4CAF50);
    background-size: 200% 100%;
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.download-success-icon {
    margin-bottom: 20px;
}

.download-success-icon i {
    font-size: 80px;
    color: #4CAF50;
    animation: successPulse 1s ease-in-out infinite alternate;
}

@keyframes successPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.download-popup-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 10px;
}

.download-popup-header p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.download-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 10px;
    width: 0%;
    animation: progressFill 3s ease-in-out forwards;
}

@keyframes progressFill {
    0% { width: 0%; }
    50% { width: 60%; }
    100% { width: 100%; }
}

.progress-text {
    font-size: 1rem;
    color: #4CAF50;
    font-weight: 600;
}

.download-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn-install {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
}

.btn-support {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.close-download-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-download-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* تأثيرات الجسيمات */
@keyframes successParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) scale(0);
        opacity: 0;
    }
}

@keyframes downloadPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* تبديل اللغة */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.lang-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 70px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

/* قسم التواصل */
.contact-section {
    margin-top: 30px;
    text-align: center;
}

.contact-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-weight: 400;
    line-height: 1.5;
}

.contact-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 25px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
    font-family: 'Tajawal', sans-serif;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.contact-btn:hover::before {
    left: 100%;
}

.contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
}

.contact-btn:active {
    transform: translateY(-1px);
}

.contact-btn i {
    font-size: 1.3rem;
    animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.contact-btn span {
    font-weight: 500;
    line-height: 1.4;
}

/* التجاوب */
@media (max-width: 768px) {
    .glass-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .welcome-text h1 {
        font-size: 2rem;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .welcome-text p {
        font-size: 1rem;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .download-option {
        padding: 20px;
        gap: 15px;
    }
    
    .download-info h3 {
        font-size: 1.2rem;
    }
    
    .popup-buttons {
        flex-direction: column;
    }
    
    .btn {
        min-width: auto;
    }
    
    .background-controls {
        top: 10px;
        left: 10px;
        flex-direction: row;
        gap: 8px;
    }
    
    .bg-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .download-popup-content {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .download-popup-header h2 {
        font-size: 1.6rem;
    }
    
    .download-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        min-width: auto;
    }
    
    .contact-text {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .contact-btn {
        padding: 20px 25px;
        font-size: 1.1rem;
        max-width: 100%;
        min-height: 55px;
    }
    
    .contact-btn span {
        font-size: 1rem;
    }
    
    .language-switcher {
        top: 10px;
        right: 10px;
        gap: 5px;
        padding: 3px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .welcome-text h1 {
        font-size: 1.8rem;
        gap: 10px;
        flex-direction: column;
        text-align: center;
    }
    
    .download-option {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .download-image {
        order: -1;
    }
    
    .contact-text {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .contact-btn {
        padding: 18px 20px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .contact-btn span {
        font-size: 0.9rem;
    }
    
    .contact-btn i {
        font-size: 1.1rem;
    }
    
    .language-switcher {
        top: 8px;
        right: 8px;
        gap: 3px;
        padding: 2px;
    }
    
    .lang-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        min-width: 50px;
    }
}

/* تنسيقات للغة الإنجليزية (LTR) */
[dir="ltr"] .welcome-text h1 {
    text-align: center;
    justify-content: center;
    flex-direction: row;
}

@media (max-width: 768px) {
    [dir="ltr"] .welcome-text h1 {
        flex-direction: column;
    }
}

[dir="ltr"] .contact-section {
    text-align: center;
}

[dir="ltr"] .popup-buttons {
    justify-content: center;
}

[dir="ltr"] .download-actions {
    justify-content: center;
}

[dir="ltr"] .language-switcher {
    right: auto;
    left: 20px;
}

@media (max-width: 768px) {
    [dir="ltr"] .language-switcher {
        left: 10px;
    }
}

@media (max-width: 480px) {
    [dir="ltr"] .language-switcher {
        left: 8px;
    }
}
