/* ============================================== */
/* 0. متغيرات الهوية البصرية الفاخرة */
/* ============================================== */
:root {
    --main-font: 'Cairo', sans-serif;
    
    /* ألوان الهوية */
    --c-light: #b5ad9e;
    --c-mid-1: #786e46; /* زيتي/كاكي */
    --c-mid-2: #756551; /* بني فاتح */
    --c-dark: #4a4235;  /* بني غامق */
    
    /* إعدادات الوضع الداكن (الافتراضي) */
    --bg-color: var(--c-dark);
    --container-bg: rgba(74, 66, 53, 0.5); /* تأثير زجاجي على البني */
    --container-border: rgba(181, 173, 158, 0.15);
    
    --text-main: var(--c-light);
    --text-muted: #958c7c;
    
    --btn-bg: rgba(117, 101, 81, 0.25);
    --btn-border: rgba(181, 173, 158, 0.2);
    --btn-text: var(--c-light);
    --icon-color: var(--c-light);
    
    --btn-hover-bg: var(--c-mid-1);
    --btn-hover-text: #ffffff;
    --icon-hover: #ffffff;
    
    --accent-color: var(--c-light);
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    --body-bg-url: url('assets/images/bag.PNG'); 
}

body.light-mode {
    /* إعدادات الوضع الفاتح */
    --bg-color: var(--c-light);
    --container-bg: rgba(255, 255, 255, 0.5); /* تأثير زجاجي مضيء */
    --container-border: rgba(74, 66, 53, 0.15);
    
    --text-main: var(--c-dark);
    --text-muted: var(--c-mid-2);
    
    --btn-bg: rgba(255, 255, 255, 0.6);
    --btn-border: rgba(74, 66, 53, 0.2);
    --btn-text: var(--c-dark);
    --icon-color: var(--c-dark);
    
    --btn-hover-bg: var(--c-dark);
    --btn-hover-text: var(--c-light);
    --icon-hover: var(--c-light);
    
    --accent-color: var(--c-dark);
    --shadow-color: rgba(74, 66, 53, 0.15);
}

/* ============================================== */
/* 1. إعدادات عامة */
/* ============================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--main-font);
    background-image: var(--body-bg-url);
    background-color: var(--bg-color);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 15px;
    position: relative;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* غشاوة الخلفية الأساسية */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 0;
    transition: background-color 0.5s ease;
}
body.light-mode::before {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ============================================== */
/* شاشة التحميل */
/* ============================================== */
#preloader {
    position: fixed;
    inset: 0;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}
#preloader.hidden { opacity: 0; visibility: hidden; }

.loader-logo img {
    width: 140px;
    height: auto;
    animation: pulse-loader 1.5s ease-in-out infinite alternate;
    margin-bottom: 25px;
}
.loader-dots { display: flex; gap: 10px; }
.loader-dots .dot {
    width: 12px; height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: bounce-loader 1.4s infinite ease-in-out both;
}
.loader-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dots .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse-loader { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.05); opacity: 1; } }
@keyframes bounce-loader { 0%, 80%, 100% { transform: scale(0); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* ============================================== */
/* 2. الحاوية الرئيسية (Glassmorphism) */
/* ============================================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 550px; /* أنحف قليلاً لأناقة أكثر */
    width: 100%;
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 20px 50px var(--shadow-color), inset 0 0 0 1px var(--container-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    text-align: center;
    transition: all 0.5s ease;
}

.profile-image {
    width: 130px; height: auto;
    margin: 0 auto 20px auto;
    display: block;
    border-radius: 50%; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border: 3px solid var(--container-border);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.profile-image:hover { transform: scale(1.08) rotate(5deg); }

.title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 30px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.3s ease;
}

/* ============================================== */
/* 3. الأزرار الاحترافية */
/* ============================================== */
.link-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    padding: 16px 20px;
    margin: 14px 0;
    border-radius: 18px; /* حواف عصرية بدلاً من الدائرية تماماً */
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid var(--btn-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.5s forwards ease-out;
}
[dir="ltr"] .link-button { justify-content: center; }

/* تأخير حركة ظهور الأزرار */
.container > .primary-btn { animation-delay: 0.1s; }
.container > .whatsapp-btn { animation-delay: 0.2s; }
.container > .social-row { animation-delay: 0.3s; opacity: 0; animation: fadeInUp 0.5s forwards ease-out; }

.link-button i {
    margin-left: 12px;
    font-size: 1.4rem;
    color: var(--icon-color);
    transition: all 0.3s ease;
}
[dir="ltr"] .link-button i { margin-left: 0; margin-right: 12px; }

.link-button:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-color);
    border-color: transparent;
}
.link-button:hover i { 
    color: var(--icon-hover); 
    transform: scale(1.15); 
}

/* صف السوشيال ميديا (جنب لجنب) */
.social-row {
    display: flex;
    gap: 15px;
    margin: 14px 0;
}
.social-row .social-btn {
    flex: 1; /* يأخذون نفس المساحة بالتساوي */
    margin: 0; 
}

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes click-feedback { 50% { transform: scale(0.95); } }
.animate-click { animation: click-feedback 0.2s ease-out; }

/* ============================================== */
/* 4. قسم الاتصال والموقع */
/* ============================================== */
.contact, .location {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid var(--container-border);
}

.contact h3, .location h3 {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 800;
}

.contact a {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid var(--btn-border);
    padding: 14px;
    border-radius: 14px;
    margin: 10px 0;
    font-size: 1.05rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    direction: ltr;
}
.contact a:hover {
    background-color: var(--btn-bg);
    border-color: var(--accent-color);
}
.contact a i { margin-right: 10px; color: var(--accent-color); }

.location iframe {
    width: 100%;
    height: 200px;
    border-radius: 18px;
    border: 1px solid var(--btn-border);
    margin-bottom: 15px;
    filter: grayscale(20%) contrast(1.1); /* لمسة احترافية للخريطة */
}
body.dark-mode .location iframe { filter: invert(90%) hue-rotate(180deg) grayscale(30%); }

.location .map-link {
    background-color: var(--c-mid-2); /* بني فاتح */
    color: #ffffff;
    border: none;
}
.location .map-link i { color: #ffffff; }
.location .map-link:hover { background-color: var(--c-mid-1); }

/* ============================================== */
/* 5. التذييل */
/* ============================================== */
.footer {
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.powered-by-linkey {
    margin-top: 15px;
}
.powered-by-linkey a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}
.powered-by-linkey a:hover { color: var(--accent-color); }
.linkey-credit-logo { width: 60px; filter: grayscale(100%) opacity(0.7); transition: all 0.3s ease; }
.powered-by-linkey a:hover .linkey-credit-logo { filter: grayscale(0%) opacity(1); }
body.light-mode .linkey-credit-logo { filter: invert(0.8) grayscale(100%); }

/* ============================================== */
/* 6. أزرار التحكم العلوية */
/* ============================================== */
.controls-container {
    position: absolute; /* داخل الحاوية أو فوقها */
    top: 20px; left: 20px;
    z-index: 10;
    display: flex; gap: 10px;
}
[dir="rtl"] .controls-container { left: auto; right: 20px; }

.control-button {
    background: var(--container-bg);
    color: var(--text-main);
    border: 1px solid var(--container-border);
    backdrop-filter: blur(10px);
    width: 45px; height: 45px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.3s ease;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.1rem;
}
.control-button:hover { 
    background: var(--btn-hover-bg); 
    color: var(--btn-hover-text);
    border-color: transparent;
    transform: translateY(-2px); 
}
#theme-toggle .fa-sun { display: none; }
body.light-mode #theme-toggle .fa-sun { display: block; }
body.light-mode #theme-toggle .fa-moon { display: none; }

/* ============================================== */
/* 7. التجاوب (الهاتف) */
/* ============================================== */
@media (max-width: 599px) {
    .container { padding: 30px 20px; border-radius: 25px; }
    .profile-image { width: 110px; }
    .title { font-size: 1.7rem; }
    .link-button { padding: 14px 15px; font-size: 1rem; }
    .controls-container { top: 15px; right: 15px; }
    .social-row { flex-direction: column; gap: 0; margin: 0; } /* يعود عمودي بالشاشات الصغيرة جداً إذا لزم الأمر، أو نتركه صفي */
    .social-row { flex-direction: row; gap: 10px; margin: 12px 0;} /* الأفضل إبقاؤه أفقي */
}