/*
 * ===================================================
 * Main Stylesheet for "Future of Islam" Website
 * Optimized for Performance - v1.0
 * ===================================================
*/

/* --- [ 1. GLOBAL & DARK MODE VARIABLES ] --- */
:root {
    --primary-color: <?php echo htmlspecialchars($site_settings['theme_color'] ?? '#0d47a1'); ?>;
    --secondary-color: #1565c0; 
    --accent-color: #f9a825;
    --font-primary: 'Cairo', sans-serif; 
    --font-secondary: 'Readex Pro', sans-serif;
    --border-radius: 12px; 
    --box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07); 
    --transition: all 0.3s ease-in-out;

    /* Light Theme Colors */
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
}

body.dark-mode {
    /* Dark Theme Colors */
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #9e9e9e;
    --border-color: #424242;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex-grow: 1; padding-top: 80px; }
a { color: var(--secondary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-color); }

/* --- [ 2. HEADER & SHARED COMPONENTS ] --- */
.header-container {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1020;
    transition: background-color 0.3s, box-shadow 0.3s;
    background-color: var(--surface-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.main-header { padding: 1rem 0; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo-link { display: flex; align-items: center; gap: 15px; text-decoration: none; }
.header-logo-img { height: 50px; }
.logo-text-ar { font-family: var(--font-primary); font-weight: 700; font-size: 1.5rem; color: var(--primary-color); }
.main-nav a { color: var(--text-muted); margin: 0 1rem; font-weight: 600; font-size: 1.1rem; position: relative; padding: 5px 0; }
.main-nav a:hover, .main-nav a.active { color: var(--primary-color); }
.main-nav a::before { content: ''; position: absolute; width: 0; height: 3px; bottom: -5px; right: 50%; transform: translateX(50%); background-color: var(--accent-color); transition: width 0.3s; border-radius: 2px; }
.main-nav a:hover::before, .main-nav a.active::before { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.action-icon { font-size: 1.5rem; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.action-icon:hover { color: var(--primary-color); }
.theme-switch { width: 50px; height: 26px; background: #e9ecef; border-radius: 50px; position: relative; cursor: pointer; }
.theme-switch .switch-handle { height: 20px; width: 20px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.theme-switch .bi { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; }
.theme-switch .bi-moon-fill { left: 6px; color: var(--text-muted); }
.theme-switch .bi-sun-fill { right: 6px; color: var(--accent-color); display: none; }
body.dark-mode .theme-switch { background: var(--primary-color); }
body.dark-mode .switch-handle { left: 27px; }
body.dark-mode .bi-moon-fill { display: none; }
body.dark-mode .bi-sun-fill { display: block; }
.search-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); z-index: 1050; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.search-modal.active { opacity: 1; visibility: visible; }
.search-modal-content { max-width: 700px; width: 90%; }
.search-modal .form-control { background: transparent; border: none; border-bottom: 3px solid var(--surface-color); color: var(--surface-color); font-size: 2.5rem; text-align: center; padding: 1rem; border-radius: 0; }
.search-modal .form-control:focus { box-shadow: none; }
.search-modal .form-control::placeholder { color: rgba(255,255,255,0.5); }
.search-modal-close { position: absolute; top: 30px; right: 30px; font-size: 3rem; color: var(--surface-color); cursor: pointer; }
.notification-bell { position: relative; }
.notification-bell .badge { position: absolute; top: -5px; right: -10px; font-size: 0.65rem; padding: 0.25em 0.5em; }
.notifications-dropdown { width: 350px; max-height: 400px; overflow-y: auto; }
.notification-item a { white-space: normal; }
.notification-item.unread { background-color: rgba(13, 110, 253, 0.05); }
body.dark-mode .notification-item.unread { background-color: rgba(255, 255, 255, 0.08); }
.notification-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-left: 10px; }
.notification-content p { font-size: 0.9rem; margin: 0; }
.dropdown-menu { border-radius: var(--border-radius); box-shadow: var(--box-shadow); border-color: var(--border-color); background-color: var(--surface-color); }
.dropdown-item { color: var(--text-color); }
.dropdown-item:hover { background-color: rgba(13, 71, 161, 0.1); color: var(--primary-color); }
body.dark-mode .dropdown-item:hover { background-color: rgba(255, 255, 255, 0.1); }
.navbar-toggler { border: none; font-size: 2.5rem; color: var(--primary-color); }
.offcanvas { background-color: var(--surface-color); }
.offcanvas .nav-link { color: var(--text-muted); padding: 0.75rem 1rem; }
.offcanvas .nav-link:hover { color: var(--primary-color); }

/* --- [ 3. FOOTER & SHARE SECTION ] --- */
.share-section-wrapper { padding: 2.5rem 0; background-color: var(--surface-color); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); text-align: center; }
.share-title { font-family: var(--font-primary); font-weight: 700; color: var(--text-color); margin-bottom: 1.5rem; }
.share-buttons { display: flex; justify-content: center; align-items: center; gap: 1rem; }
.share-btn { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 50%; font-size: 1.5rem; color: #fff !important; text-decoration: none; transition: var(--transition); border: none; cursor: pointer; }
.share-btn:hover { transform: scale(1.1) translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.twitter { background-color: #1DA1F2; }
.share-btn.whatsapp { background-color: #25D366; }
.share-btn.telegram { background-color: #0088cc; }
.share-btn.linkedin { background-color: #0A66C2; }
.share-btn.copy { background-color: #6c757d; position: relative; }
.share-btn.copy .copy-feedback { display: none; font-size: 0.8rem; font-weight: bold; }
.share-btn.copy.copied .copy-icon { display: none; }
.share-btn.copy.copied .copy-feedback { display: block; }
.main-footer { background-color: #1a222f; color: rgba(255, 255, 255, 0.7); padding-top: 4rem; margin-top: 0; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2.5rem; padding-bottom: 3rem; }
.footer-section h5 { font-family: var(--font-primary); color: var(--surface-color); font-weight: 700; margin-bottom: 1.5rem; position: relative; padding-bottom: 0.75rem; }
.footer-section h5::after { content: ''; position: absolute; bottom: 0; right: 0; width: 45px; height: 3px; background-color: var(--accent-color); border-radius: 2px; }
.footer-logo { margin-bottom: 1rem; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.5rem; font-weight: 900; color: var(--surface-color); }
.footer-logo-img { height: 40px; }
.footer-description { color: rgba(255, 255, 255, 0.6); line-height: 1.8; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.85rem; }
.footer-links a { color: rgba(255, 255, 255, 0.7); transition: var(--transition); display: inline-block; }
.footer-links a:hover { color: var(--surface-color); transform: translateX(-5px); }
.footer-social-links { display: flex; gap: 1rem; margin-top: 1.5rem; }
.footer-social-links a { color: rgba(255, 255, 255, 0.7); font-size: 1.5rem; }
.footer-social-links a:hover { color: var(--accent-color); transform: translateY(-2px); }
.newsletter-form .form-control { background-color: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; }
.newsletter-form .form-control::placeholder { color: rgba(255,255,255,0.5); }
.newsletter-form .btn { background-color: var(--accent-color); color: var(--primary-color); font-weight: 700; }
.language-bar { background-color: rgba(0, 0, 0, 0.2); padding: 1.5rem 0; text-align: center; }
.language-switcher { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.lang-btn { background-color: rgba(255, 255, 255, 0.1); color: var(--surface-color) !important; padding: 0.4rem 1rem; border-radius: 50px; font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; transition: var(--transition); text-decoration: none; }
.lang-btn:hover, .lang-btn.active { background-color: var(--accent-color); border-color: var(--accent-color); color: var(--primary-color) !important; }
.footer-bottom { background-color: #111722; padding: 1.5rem 0; text-align: center; font-size: 0.9rem; }
.footer-bottom p { margin: 0; }

/* --- [ 4. PAGE-SPECIFIC STYLES ] --- */
/* You can add any remaining page-specific styles here if needed */
/* For example, the styles for index.php, profile.php, etc. */

