/* تحسينات إضافية للموقع الخيري - M.K. Maram Kingsley */

/* تحسينات النافذة المنبثقة */
.modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal[style*="block"] .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* تحسينات أزرار المبالغ */
.amount-btn {
    position: relative;
    overflow: hidden;
}

.amount-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.amount-btn:active::before {
    width: 300px;
    height: 300px;
}

/* تحسينات البطاقات */
.campaign-card {
    position: relative;
    overflow: hidden;
}

.campaign-card::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;
}

.campaign-card:hover::before {
    left: 100%;
}

/* شريط التقدم المحسن */
.progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* تحسينات الإحصائيات */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-number {
    position: relative;
    z-index: 2;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: transform 0.5s ease;
}

.stat-card:hover::before {
    transform: rotate(45deg) scale(1.1);
}

/* تأثيرات التمرير */
.hero-content {
    animation: fadeInUp 1s ease-out;
}

.campaign-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.campaign-card:nth-child(1) { animation-delay: 0.1s; }
.campaign-card:nth-child(2) { animation-delay: 0.2s; }
.campaign-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسينات الأزرار */
.cta-button, .donate-btn, .submit-btn {
    position: relative;
    overflow: hidden;
}

.cta-button::before, .donate-btn::before, .submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.cta-button:active::before, .donate-btn:active::before, .submit-btn:active::before {
    width: 300px;
    height: 300px;
}

/* تحسينات الرأس */
header {
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #c41e3a;
    transition: all 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
    left: 0;
}

/* تحسينات النموذج */
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* تحسينات معلومات البنك */
.bank-detail {
    transition: all 0.3s ease;
}

.bank-detail:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-5px);
}

/* تحسينات التذييل */
.footer-section a {
    position: relative;
    transition: color 0.3s ease;
}

.footer-section a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #c41e3a;
    transition: width 0.3s ease;
}

.footer-section a:hover::before {
    width: 100%;
}

/* تحسينات الاستجابة للأجهزة المحمولة */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
        animation-delay: 0.2s;
    }
    
    .hero-content p {
        font-size: 1.1rem;
        animation-delay: 0.4s;
    }
    
    .cta-button {
        animation-delay: 0.6s;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .donation-amounts {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* تحسينات إمكانية الوصول */
.amount-btn:focus, .donate-btn:focus, .submit-btn:focus, .copy-btn:focus {
    outline: 2px solid #c41e3a;
    outline-offset: 2px;
}

/* تحسينات الطباعة */
@media print {
    header, .modal, .cta-button, .donate-btn {
        display: none !important;
    }
    
    .hero {
        height: auto;
        padding: 2rem 0;
        background: white;
        color: black;
    }
    
    .campaign-card, .stat-card, .bank-info {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* تحسينات الألوان للوضع المظلم (اختياري) */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background-color: #2d2d2d;
        color: white;
    }
    
    .form-group input, .form-group textarea {
        background-color: #3d3d3d;
        color: white;
        border-color: #555;
    }
    
    .amount-btn {
        background-color: #3d3d3d;
        color: white;
        border-color: #555;
    }
}

/* تأثيرات التحميل */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* تحسينات الأداء */
.campaign-image, .about-image {
    will-change: transform;
}

.hero {
    will-change: background-position;
}

/* تحسينات التفاعل */
.interactive-element {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.interactive-element:active {
    transform: scale(0.98);
}

/* تحسينات النصوص */
.highlight-text {
    background: linear-gradient(120deg, #c41e3a 0%, #c41e3a 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    transition: background-size 0.25s ease-in;
}

.highlight-text:hover {
    background-size: 100% 88%;
    color: white;
}
