/* Import at the top of your CSS file */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');

:root {
    --primary-color: #34495e;
    --primary-dark: #2c3e50;
    --secondary-color: #ffd700;
    --accent-gold: #ffcf33;
    --bg-light: #f8fafc;
    --bg-cream: #fcfaf2;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Global Reset & Orientation Lock */
html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

body { 
    background: #f5f7fa; 
    min-height: 100vh;
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
    font-family: 'Cairo',  sans-serif !important;
}

/* Common Header Styles */
.ai-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white; padding: 15px; text-align: center;
    border-radius: 0 0 25px 25px; box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px; width: 100%;
}

.ai-header-icon { font-size: 2.2rem; color: var(--secondary-color); animation: pulse 2s infinite; display: inline-block; vertical-align: middle; margin-left: 10px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.ai-header h3 { font-size: 1.3rem; font-weight: 800; margin: 0; display: inline-block; vertical-align: middle; }

/* Main Container & Grid */
.container-custom { width: 100%; padding: 0 15px 40px; box-sizing: border-box; background: var(--bg-light); min-height: 100vh; }
.ai-grid { display: grid; grid-template-columns: 1fr; gap: 28px; width: 100%; padding-top: 10px; }
@media (min-width: 768px) { .ai-grid { grid-template-columns: repeat(2, 1fr); } }

/* Cards Strategy - Default Vertical */
.ai-card {
    background: white; border-radius: 18px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07); border: 1px solid rgba(0,0,0,0.04);
    position: relative; transition: all 0.3s ease;
    display: flex; flex-direction: column;
    margin-bottom: 5px;
}
.ai-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); }

/* Slim Card Variant */
.ai-card.card-slim { min-height: auto !important; margin-bottom: 2px; }
.ai-card.card-slim .card-header-side { padding: 10px 15px !important; flex: 0 0 auto !important; border-left: none !important; }
.ai-card.card-slim .card-title { font-size: 1.05rem !important; }
.ai-card.card-slim .card-subtitle { font-size: 0.75rem !important; margin-top: 2px; }
.ai-card.card-slim .number-badge-pill { width: 24px; height: 24px; font-size: 0.75rem; }

/* Desktop Landscape Mode for Cards */
@media (min-width: 992px) {
    .ai-grid { grid-template-columns: 1fr; gap: 35px; } 
    .ai-card { flex-direction: row; flex-wrap: wrap; align-items: stretch; min-height: 140px; }
    
    .card-header-side { flex: 0 0 350px; border-bottom: none !important; border-left: 1px solid #f0f0f0; padding: 25px !important; }
    .card-body-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 30px; }
    .card-action-btn-area { margin: 10px 0 0 auto !important; }
    .details-expandable { width: 100%; border-top: 1px solid #f0f0f0; }
}

/* Card Internal Components */
.card-header-side { 
    padding: 15px; 
    background: linear-gradient(to bottom, #fcfdfd, #f4f7f6); 
    border-bottom: 1px solid #f0f0f0;
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}

.card-title { font-size: 1.25rem; font-weight: 800; margin: 0; color: #2c3e50; text-align: right; }
.card-subtitle { color: var(--text-muted); font-size: 0.85rem; line-height: 1.4; margin-top: 5px; text-align: right; }
.card-icon-main { font-size: 1.6rem; color: var(--primary-dark); }

.number-badge-pill {
    width: 28px; height: 28px; background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    font-weight: 800; font-size: 0.85rem; flex-shrink: 0;
}

/* Buttons & Toggles */
.toggle-btn-pill {
    width: auto; min-width: 140px; margin: 15px 18px 15px auto; padding: 8px 18px;
    background: white;
    border: 1.5px solid var(--primary-color); border-radius: 30px; color: var(--primary-color);
    font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 0.85rem; transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.toggle-btn-pill:hover { background: var(--primary-color); color: white; transform: translateY(-1px); box-shadow: 0 5px 12px rgba(0,0,0,0.1); }
.toggle-btn-pill.active { background: var(--primary-dark); color: white; border-color: var(--primary-dark); }

.details-expandable { max-height: 0; overflow: hidden; transition: 0.5s cubic-bezier(0, 1, 0, 1); background: #fdfdfd; }
.details-expandable.open { max-height: 800px; transition: 0.5s ease-in-out; }

/* Action Buttons */
.ai-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 12px; border-radius: 10px; font-weight: 700; text-decoration: none;
    transition: all 0.3s; border: none; cursor: pointer; font-size: 0.85rem;
}
.btn-primary-alt { background: #e8f5e9; color: #1b5e20; border: 1.5px solid #66eaa8; }
.btn-primary-alt:hover { background: #c8e6c9; }
.btn-secondary-alt { background: #e3f2fd; color: #0d47a1; border: 1.5px solid #90caf9; }
.btn-secondary-alt:hover { background: #bbdefb; }

/* Modals */
.ai-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: none; align-items: center;
    justify-content: center; z-index: 2000; padding: 15px; backdrop-filter: blur(4px);
}
.ai-modal-content {
    background: white; width: 100%; max-width: 380px;
    border-radius: 25px; overflow: hidden; animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ai-modal-header { background: var(--primary-dark); color: white; padding: 18px; text-align: center; font-weight: 800; font-size: 1.1rem; }
.ai-modal-body { padding: 25px; text-align: center; }
.ai-modal-footer { padding: 0 20px 25px; display: flex; gap: 10px; }

/* RTL Tweaks */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.rtl-reverse { direction: ltr; }

/* Premium Home Page Components */
.ai-section-title {
    font-size: 1.1rem; font-weight: 800; color: var(--primary-dark);
    display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.ai-section-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft-bg); color: var(--primary-color); font-size: 1.2rem;
}

.ai-scroll-container {
    display: flex; gap: 15px; overflow-x: auto; padding: 10px 5px 20px;
    scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none;
}
.ai-scroll-container::-webkit-scrollbar { display: none; }

.ai-quick-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 15px; background: white; border-radius: 15px;
    border: 1px solid var(--border-color); color: var(--primary-dark);
    text-decoration: none; transition: all 0.3s; text-align: center;
}
.ai-quick-link:hover { transform: translateY(-3px); border-color: var(--accent-gold); box-shadow: var(--shadow-md); }
.ai-quick-link i { font-size: 1.8rem; margin-bottom: 8px; color: var(--primary-color); }

.ai-list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: white; border-radius: 12px; margin-bottom: 10px;
    text-decoration: none; color: inherit; transition: all 0.2s;
    border: 1px solid transparent;
}
.ai-list-item:hover { background: var(--bg-light); border-color: var(--border-color); }
.ai-icon-sq {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}

.ai-news-card {
    background: white; border-radius: 15px; overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
    transition: all 0.3s;
}
.ai-news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.news-img-wrap { width: 100%; height: 180px; overflow: hidden; }
.news-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.ai-news-card:hover .news-img-wrap img { transform: scale(1.05); }
.news-body { padding: 15px; }

/* Global Link Resets */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Premium Modern Footer */
.footer-modern {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 50px !important;
    color: var(--text-dark);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 15px;
    max-width: 300px;
}

.footer-links h6 {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: inline-block;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Fix for existing links in other components */
.ai-list-item, .ai-card, .ai-quick-link {
    text-decoration: none !important;
}

/* Premium Hub Cards & Layouts */
.hub-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.hub-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.hub-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.hub-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.hub-title h6 {
    margin: 0;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary-dark);
}

/* Hub Items */
.hub-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: 0.3s;
    border: 1px solid transparent;
}

.hub-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateX(-5px);
}

.hub-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.hub-item-content {
    flex-grow: 1;
}

.hub-item-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    display: block;
}

.hub-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Hub Buttons */
.hub-footer {
    margin-top: auto;
    padding-top: 15px;
}

.hub-btn-full {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s;
    border: none;
    text-decoration: none;
}

/* Specific Hub Themes */
.hub-health .hub-icon-wrap { background: #fee2e2; color: #ef4444; }
.hub-health .hub-item-icon { background: white; color: #ef4444; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1); }

.hub-business .hub-icon-wrap { background: #f1f5f9; color: #475569; }
.hub-business .hub-item-icon { background: white; color: #475569; box-shadow: 0 2px 8px rgba(71, 85, 105, 0.1); }

.hub-info .hub-icon-wrap { background: #e0f2fe; color: #0284c7; }
.hub-info .hub-item-icon { background: white; color: #0284c7; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1); }

/* Quick Grid for Business */
.hub-grid-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.hub-mini-link {
    background: #f8fafc;
    border-radius: 14px;
    padding: 15px 10px;
    text-align: center;
    transition: 0.3s;
    border: 1px solid transparent;
    color: var(--text-dark);
    text-decoration: none;
}

.hub-mini-link:hover {
    background: white;
    border-color: var(--accent-gold);
    transform: translateY(-3px);
    color: var(--primary-color);
}

.hub-mini-link i { font-size: 1.4rem; margin-bottom: 5px; display: block; }
.hub-mini-link span { font-weight: 700; font-size: 0.85rem; }

/* Category Pills Styling - Premium Version */
.category-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
    margin: 0 auto;
    max-width: 1000px;
}

.category-pill-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px; /* Boxy-pill shape */
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    text-decoration: none !important;
}

.category-pill-modern:hover {
    background: white;
    border-color: var(--accent-gold);
    color: var(--primary-color) !important;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
}

.category-pill-modern i {
    font-size: 1.3rem;
    transition: 0.3s;
}

.category-pill-modern:hover i {
    transform: rotate(-10deg) scale(1.1);
}

@media (max-width: 768px) {
    .category-pills-row {
        gap: 10px;
        padding: 10px;
    }
    .category-pill-modern {
        padding: 10px 18px;
        font-size: 0.85rem;
        border-radius: 12px;
    }
.category-pill-modern i {
        font-size: 1.1rem;
    }
}

/* Premium Unified Breadcrumbs */
.breadcrumb {
    background: transparent !important;
    padding: 10px 0 !important;
    margin-bottom: 1.5rem !important;
    font-size: 0.85rem;
    font-weight: 600;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--text-muted);
    transition: all 0.3s;
    text-decoration: none !important;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.breadcrumb-item.active {
    color: var(--primary-dark);
    font-weight: 800;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\F285" !important; /* Bootstrap Icon: chevron-left */
    font-family: "bootstrap-icons" !important;
    font-size: 0.7rem;
    color: #cbd5e1;
    padding-left: 12px;
    padding-right: 12px;
}

/* Fix for some pages using direct text separators */
.breadcrumb-item li, .breadcrumb li {
    list-style: none;
}

/* Global Animations */
@keyframes shake-violent {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-20px); }
    20%, 40%, 60%, 80% { transform: translateX(20px); }
}

.shake-violent {
    animation: shake-violent 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes pulse-intense {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4); }
    50% { transform: scale(1.03); box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4); }
}

.animate-pulse-intense {
    animation: pulse-intense 2s infinite ease-in-out;
}
