/* ============================================= */
/* theme.css - ملف الثيم الموحد                  */
/* ============================================= */

/* ============================================= */
/* 1. الخطوط والمتغيرات العامة                   */
/* ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* الألوان الأساسية */
    --primary-color: #1a2a45;
    --primary-light: #2c3e50;
    --secondary-color: #bfa06a;
    --accent-light: #f3e5c2;
    
    /* ألوان الخلفية */
    --background-color: #f8f9fa;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --nav-glass: rgba(255, 255, 255, 0.85);
    
    /* ألوان النصوص */
    --text-color: #343a40;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --light-text-color: #f1f1f1;
    
    /* ألوان الحالات */
    --danger: #ef4444;
    --success: #10b981;
    --white: #ffffff;
    
    /* الأبعاد */
    --border-radius: 15px;
    --radius: 16px;
    
    /* الظلال */
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* الفوتر */
    --footer-bg-color: #1a2a45;
}

/* ============================================= */
/* 2. إعادة التعيين والأساسيات                   */
/* ============================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

ul, li { list-style: none !important; padding: 0; margin: 0; }
a { text-decoration: none; transition: all 0.3s ease; }
button { font-family: 'Cairo', 'Tajawal', sans-serif; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.hidden { display: none !important; }

/* ============================================= */
/* 3. الأزرار                                    */
/* ============================================= */
.btn {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    padding: 14px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    z-index: 1;
}

.btn span { pointer-events: none; }
.btn-primary { background-color: var(--secondary-color); color: var(--primary-color); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(191, 160, 106, 0.4); }
.btn-secondary { background-color: var(--surface-color); color: var(--primary-color); border: 2px solid var(--primary-color); }
.btn-secondary:hover { background-color: var(--primary-color); color: var(--surface-color); }

.btn-navy { background: var(--primary-color); color: white; }
.btn-navy:hover { background: #132035; }
.btn-gold { background: var(--secondary-color); color: white; }
.btn-gold:hover { background: #a68b5b; }
.btn-red { background: #fee2e2; color: var(--danger); }
.btn-red:hover { background: #fecaca; }

/* تأثيرات الزر */
.btn .ripple, .btn .gavel-strike { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; border-radius: 50%; }
.btn .ripple { width: 100%; height: 100%; background-color: var(--secondary-color); transform: translate(-50%, -50%) scale(0); }
.btn .gavel-strike { color: var(--primary-color); font-size: 1.8em; }
.btn:hover .ripple { animation: ripple-hover-effect 0.8s ease-out; }
.btn:hover .gavel-strike { animation: gavel-hover-effect 0.7s ease-out; }

@keyframes ripple-hover-effect { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0.6; } 100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; } }
@keyframes gavel-hover-effect { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(40deg) scale(0.5); } 30% { transform: translate(-50%, -50%) rotate(-15deg) scale(1.2); } 50% { transform: translate(-50%, -50%) rotate(0deg) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(5deg) scale(1.5); } }

/* ============================================= */
/* 4. البطاقات                                   */
/* ============================================= */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-5px); }

/* ============================================= */
/* 5. حقول الإدخال                               */
/* ============================================= */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 15px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(191, 160, 106, 0.1);
}

/* ============================================= */
/* 6. الأقسام                                    */
/* ============================================= */
.content-section { padding: 80px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: clamp(2rem, 5vw, 2.8rem); color: var(--primary-color); margin: 0 0 10px; font-weight: 700; }
.section-header p { font-size: 1.1rem; color: #6c757d; max-width: 600px; margin: 0 auto; }
.bg-light { background-color: #f0f2f5; }

/* ============================================= */
/* 7. الشبكات                                    */
/* ============================================= */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
@media (min-width: 1200px) { .goals-grid { grid-template-columns: repeat(4, 1fr); } }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ============================================= */
/* 8. بطاقات الأهداف                             */
/* ============================================= */
.goal-card {
    background: var(--surface-color);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
}

.goal-card p { flex-grow: 1; font-size: clamp(0.9rem, 2.5vw, 1rem); }
.goal-card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); }
.goal-card .icon { font-size: 1rem; color: var(--primary-color); margin-bottom: 20px; }
.goal-card h3 { margin: 0 0 10px; color: var(--primary-color); font-size: clamp(1.2rem, 4vw, 1.5rem); }

.goal-card-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary-color);
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.goal-card-btn i { margin-left: 5px; transition: transform 0.3s ease; }
.goal-card-btn:hover { background-color: var(--secondary-color); color: var(--surface-color); }

/* ============================================= */
/* 9. بطاقات الأخبار                             */
/* ============================================= */
.news-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.news-card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); }
.news-card-image { height: 200px; background-color: var(--primary-color); color: var(--secondary-color); display: flex; align-items: center; justify-content: center; font-size: 4rem; flex-shrink: 0; }
.news-card .news-card-img-top { width: 100%; height: 200px; object-fit: cover; cursor: pointer; transition: opacity 0.3s ease; flex-shrink: 0; }
.news-card .news-card-img-top:hover { opacity: 0.8; }
.news-card-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.news-card-content h3 { margin: 0 0 10px; font-size: 1.4rem; }
.news-card-content p { margin: 0 0 10px; color: #6c757d; flex-grow: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* ============================================= */
/* 10. النوافذ المنبثقة (Modals)                 */
/* ============================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.modal-content { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.close-btn { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.close-btn:hover { color: #bbb; }

.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 42, 69, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.overlay.hidden { opacity: 0; pointer-events: none; }

/* ============================================= */
/* 11. الفوتر                                    */
/* ============================================= */
footer {
    background-color: var(--footer-bg-color);
    color: #bdc3c7;
    padding: 40px 0;
    text-align: center;
    margin-top: auto;
}

.footer-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.social-links a { color: var(--light-text-color); font-size: 1.5rem; margin: 0 10px; transition: color 0.3s ease; }
.social-links a:hover { color: var(--secondary-color); }

/* ============================================= */
/* 12. الأزرار العائمة                           */
/* ============================================= */
.floating-btn, #admin-fab, #suggestion-fab {
    position: fixed;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 998;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

.floating-btn:hover, #admin-fab:hover, #suggestion-fab:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
    color: var(--primary-color);
}

.floating-btn { bottom: 25px; left: 25px; }
#admin-fab { bottom: 25px; right: 25px; }
#suggestion-fab { bottom: 90px; right: 25px; }

/* ============================================= */
/* 13. التأثيرات والحركات                        */
/* ============================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================= */
/* 14. التوست والتنبيهات                         */
/* ============================================= */
#toast-container { position: fixed; top: 20px; left: 20px; z-index: 3000; }
.toast {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* ============================================= */
/* 15. الاستجابة للجوال                          */
/* ============================================= */
@media (max-width: 768px) {
    .content-section { padding: 50px 0; }
    
    .goals-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    .goal-card { padding: 20px 10px; }
    .goal-card .icon { font-size: 1.8rem; margin-bottom: 5px; }
    .goal-card h3 { margin: 0 0 3px; line-height: 1.1; }
    .goal-card p { line-height: 1.3; margin-bottom: 0; }
    .goal-card-btn { margin-top: 10px; padding: 5px 12px; font-size: 0.7rem; }
}

@media (max-width: 992px) {
    .about-layout { flex-direction: column-reverse; text-align: center; }
}
