/* ============== Public Website Styles ============== */
:root {
    --p-bg: #ffffff;
    --p-bg-soft: #f8faf8;
    --p-text: #1a2620;
    --p-text-muted: #6b7280;
    --p-border: #e5e7eb;
    --p-card: #ffffff;
    --p-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --p-shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
    --p-navbar-bg: rgba(255,255,255,0.92);
}
[data-theme="dark"] {
    --p-bg: #0f1715;
    --p-bg-soft: #16201d;
    --p-text: #e6f1ec;
    --p-text-muted: #94a3a0;
    --p-border: #2a3530;
    --p-card: #1a2420;
    --p-shadow: 0 4px 20px rgba(0,0,0,0.35);
    --p-shadow-hover: 0 12px 40px rgba(0,0,0,0.5);
    --p-navbar-bg: rgba(15,23,21,0.92);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: var(--p-bg);
    color: var(--p-text);
    margin: 0;
    transition: background .3s, color .3s;
}
a { color: var(--p-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--p-secondary); }
img { max-width: 100%; height: auto; display: block; }

/* Navbar */
.public-navbar {
    background: var(--p-navbar-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--p-border);
    padding: 12px 0;
    transition: all .3s;
}
.public-navbar .navbar-brand { color: var(--p-text); font-size: 1.15rem; }
.public-navbar .nav-link {
    color: var(--p-text); font-weight: 500; padding: 8px 14px !important;
    position: relative; transition: color .2s;
}
.public-navbar .nav-link:hover { color: var(--p-primary); }
.public-navbar .nav-link.active { color: var(--p-primary); }
.public-navbar .nav-link::after {
    content: ''; position: absolute; bottom: 4px; right: 14px; left: 14px;
    height: 2px; background: var(--p-primary); transform: scaleX(0);
    transition: transform .25s;
}
.public-navbar .nav-link:hover::after, .public-navbar .nav-link.active::after { transform: scaleX(1); }

.brand-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
}
.btn-primary-grad {
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; border: none; border-radius: 10px; font-weight: 600;
    transition: all .25s;
}
.btn-primary-grad:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(76,175,80,0.35); }
.btn-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--p-bg-soft); border: 1px solid var(--p-border);
    color: var(--p-text); display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.btn-icon:hover { background: var(--p-primary); color: #fff; border-color: var(--p-primary); }
.theme-toggle .light-icon { display: none; }
[data-theme="dark"] .theme-toggle .dark-icon { display: none; }
[data-theme="dark"] .theme-toggle .light-icon { display: inline; }

/* Main */
.public-main { min-height: calc(100vh - 200px); padding-bottom: 80px; }

/* Hero */
.hero {
    position: relative; min-height: 88vh; display: flex; align-items: center;
    color: #fff; overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    animation: heroZoom 25s ease-in-out infinite alternate;
    filter: brightness(0.5);
}
.hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(27,94,32,0.5), rgba(0,0,0,0.6));
}
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-content { position: relative; z-index: 2; padding: 80px 0; }
.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 800;
    margin-bottom: 18px; text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: fadeUp 1s ease;
}
.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem); margin-bottom: 28px;
    color: rgba(255,255,255,0.9); animation: fadeUp 1s ease .2s both;
}
.hero-cta { animation: fadeUp 1s ease .4s both; }
.btn-hero {
    padding: 14px 32px; border-radius: 50px; font-weight: 700;
    font-size: 1.05rem; border: none;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; transition: all .3s;
    box-shadow: 0 10px 25px rgba(76,175,80,0.4);
}
.btn-hero:hover { transform: translateY(-3px); box-shadow: 0 16px 35px rgba(76,175,80,0.55); color: #fff; }
.btn-hero.outline { background: transparent; border: 2px solid #fff; box-shadow: none; }
.btn-hero.outline:hover { background: #fff; color: var(--p-secondary); }

@keyframes fadeUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

/* Section */
.section { padding: 70px 0; }
.section-soft { background: var(--p-bg-soft); }
.section-title {
    text-align: center; margin-bottom: 50px;
}
.section-title small {
    display: inline-block; color: var(--p-primary); font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; font-size: .82rem;
    margin-bottom: 8px;
}
.section-title h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800;
    color: var(--p-text); margin: 0;
}
.section-title .divider {
    width: 60px; height: 3px;
    background: linear-gradient(90deg, var(--p-primary), var(--p-secondary));
    margin: 14px auto 0; border-radius: 2px;
}

/* Cards */
.feature-card {
    background: var(--p-card); border-radius: 18px; padding: 28px 22px;
    text-align: center; box-shadow: var(--p-shadow);
    border: 1px solid var(--p-border);
    transition: all .3s; height: 100%;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--p-shadow-hover); }
.feature-card .feature-icon {
    width: 70px; height: 70px; border-radius: 50%;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.8rem; margin-bottom: 18px;
}
.feature-card h5 { color: var(--p-text); font-weight: 700; }
.feature-card p { color: var(--p-text-muted); font-size: .92rem; margin: 0; }

/* Package Card */
.pkg-card {
    background: var(--p-card); border-radius: 20px; padding: 32px 24px;
    box-shadow: var(--p-shadow); border: 2px solid var(--p-border);
    text-align: center; transition: all .3s; height: 100%;
    position: relative; overflow: hidden;
}
.pkg-card:hover { transform: translateY(-8px); box-shadow: var(--p-shadow-hover); border-color: var(--p-primary); }
.pkg-card.featured {
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; border-color: var(--p-primary);
    transform: scale(1.05);
}
.pkg-card.featured h4, .pkg-card.featured .pkg-price { color: #fff; }
.pkg-card.featured .pkg-feat { color: rgba(255,255,255,0.9); border-bottom-color: rgba(255,255,255,0.2); }
.pkg-card.featured::before {
    content: 'الأكثر طلباً'; position: absolute; top: 20px; left: -38px;
    background: #ffc107; color: #000; padding: 6px 40px; font-size: .75rem;
    font-weight: 700; transform: rotate(-45deg);
}
.pkg-icon {
    font-size: 2.4rem; color: var(--p-primary); margin-bottom: 12px;
}
.pkg-card.featured .pkg-icon { color: #fff; }
.pkg-card h4 { font-weight: 800; margin-bottom: 10px; color: var(--p-text); }
.pkg-price {
    font-size: 2.2rem; font-weight: 800; color: var(--p-primary);
    margin: 16px 0;
}
.pkg-price small { font-size: .85rem; color: var(--p-text-muted); font-weight: 500; }
.pkg-feat {
    padding: 10px 0; color: var(--p-text-muted);
    border-bottom: 1px solid var(--p-border); font-size: .9rem;
}
.pkg-feat:last-child { border-bottom: none; }

/* Trainer Card */
.trainer-card {
    background: var(--p-card); border-radius: 18px; overflow: hidden;
    box-shadow: var(--p-shadow); transition: all .3s; height: 100%;
    text-align: center; border: 1px solid var(--p-border);
}
.trainer-card:hover { transform: translateY(-6px); box-shadow: var(--p-shadow-hover); }
.trainer-card .trainer-photo {
    width: 100%; height: 280px; object-fit: cover; background: var(--p-bg-soft);
}
.trainer-card .placeholder-photo {
    width: 100%; height: 280px;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.5); font-size: 4rem;
}
.trainer-info { padding: 22px; }
.trainer-info h5 { color: var(--p-text); margin: 0 0 6px; font-weight: 700; }
.trainer-info .trainer-spec { color: var(--p-primary); font-size: .9rem; font-weight: 600; }
.trainer-info p { color: var(--p-text-muted); font-size: .87rem; margin-top: 10px; }

/* Workout Card */
.workout-card {
    background: var(--p-card); border-radius: 16px; overflow: hidden;
    box-shadow: var(--p-shadow); transition: all .3s; height: 100%;
    border: 1px solid var(--p-border);
}
.workout-card:hover { transform: translateY(-4px); box-shadow: var(--p-shadow-hover); }
.workout-card .wo-img {
    width: 100%; height: 200px; object-fit: cover; background: var(--p-bg-soft);
}
.workout-card .wo-img.placeholder {
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 3rem;
}
.workout-card .wo-body { padding: 18px; }
.workout-card h5 { color: var(--p-text); font-weight: 700; margin-bottom: 8px; font-size: 1.05rem; }
.workout-card .wo-meta {
    display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem;
    color: var(--p-text-muted); margin: 10px 0;
}
.workout-card .wo-meta span { display: inline-flex; align-items: center; gap: 4px; }
.wo-difficulty {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
}
.wo-difficulty.beginner { background: #d4edda; color: #155724; }
.wo-difficulty.intermediate { background: #fff3cd; color: #856404; }
.wo-difficulty.advanced { background: #f8d7da; color: #721c24; }

/* Gallery */
.gallery-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery-item {
    aspect-ratio: 1/1; overflow: hidden; border-radius: 12px;
    cursor: pointer; position: relative;
    box-shadow: var(--p-shadow);
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s;
}
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item::after {
    content: '\f00e'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; inset: 0; background: rgba(0,0,0,0.5);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; opacity: 0; transition: opacity .3s;
}
.gallery-item:hover::after { opacity: 1; }

/* Forms */
.form-control, .form-select {
    background: var(--p-card); border: 1.5px solid var(--p-border);
    color: var(--p-text); padding: 12px 16px; border-radius: 10px;
    font-family: inherit; transition: all .25s;
}
.form-control:focus, .form-select:focus {
    background: var(--p-card); border-color: var(--p-primary); color: var(--p-text);
    box-shadow: 0 0 0 4px rgba(76,175,80,0.12);
}
.form-label { color: var(--p-text); font-weight: 500; margin-bottom: 6px; }

/* Footer */
.public-footer {
    background: var(--p-bg-soft);
    border-top: 1px solid var(--p-border);
    color: var(--p-text);
}
.public-footer h5, .public-footer h6 { color: var(--p-text); }
.public-footer a { color: var(--p-text-muted); }
.public-footer a:hover { color: var(--p-primary); }
.social-links { display: flex; gap: 10px; }
.social-links a {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--p-card); border: 1px solid var(--p-border);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--p-text); transition: all .25s;
}
.social-links a:hover {
    background: var(--p-primary); color: #fff; border-color: var(--p-primary);
    transform: translateY(-3px);
}

/* Mobile Bottom Navbar */
.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    background: var(--p-card);
    border-top: 1px solid var(--p-border);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    display: flex; justify-content: space-around; align-items: center;
    padding: 6px 4px; padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.mobile-bottom-nav .mb-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 6px 0; color: var(--p-text-muted); text-decoration: none;
    font-size: .68rem; font-weight: 600; transition: all .2s;
    border-radius: 10px;
}
.mobile-bottom-nav .mb-item i { font-size: 1.15rem; margin-bottom: 2px; }
.mobile-bottom-nav .mb-item.active, .mobile-bottom-nav .mb-item:hover {
    color: var(--p-primary);
    background: rgba(76,175,80,0.08);
}

/* AI Chat Widget */
.ai-chat-toggle {
    position: fixed; bottom: 90px; left: 20px; z-index: 1040;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 8px 25px rgba(76,175,80,0.4);
    font-size: 1.5rem; transition: all .3s;
}
.ai-chat-toggle:hover { transform: scale(1.1); }
.ai-chat-toggle.hidden { transform: scale(0); opacity: 0; pointer-events: none; }
.ai-pulse {
    position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--p-primary);
    animation: aiPulse 2s ease-out infinite;
}
@keyframes aiPulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

@media (min-width: 992px) {
    .ai-chat-toggle { bottom: 24px; }
}

.ai-chat-box {
    position: fixed; bottom: 0; left: 0; right: 0; max-height: 70vh;
    background: var(--p-card); z-index: 1050;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform .3s ease;
    border: 1px solid var(--p-border);
}
.ai-chat-box.open { transform: translateY(0); }
@media (min-width: 768px) {
    .ai-chat-box {
        left: 20px; right: auto; bottom: 20px; width: 380px;
        max-height: 600px; border-radius: 20px;
    }
}
.ai-chat-header {
    padding: 16px; background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; border-radius: 20px 20px 0 0;
    display: flex; justify-content: space-between; align-items: center;
}
.btn-close-ai {
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
}
.ai-chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    min-height: 300px; max-height: 400px;
}
.ai-msg { display: flex; gap: 8px; align-items: flex-end; }
.ai-msg-user { justify-content: flex-start; }
.ai-msg > i {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: .85rem; flex-shrink: 0;
}
.ai-msg-bubble {
    background: var(--p-bg-soft); padding: 10px 14px; border-radius: 16px;
    font-size: .92rem; max-width: 75%; color: var(--p-text);
    word-wrap: break-word;
}
.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff;
}
.ai-typing .dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--p-text-muted); margin: 0 2px;
    animation: typing 1.2s infinite;
}
.ai-typing .dot:nth-child(2){ animation-delay: .2s; }
.ai-typing .dot:nth-child(3){ animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }
.ai-chat-input {
    display: flex; padding: 12px; gap: 8px;
    border-top: 1px solid var(--p-border); background: var(--p-card);
    border-radius: 0 0 20px 20px;
}
.ai-chat-input input {
    flex: 1; padding: 10px 14px; border-radius: 20px;
    border: 1px solid var(--p-border); font-family: inherit;
    background: var(--p-bg-soft); color: var(--p-text);
}
.ai-chat-input input:focus { outline: none; border-color: var(--p-primary); }
.ai-chat-input button {
    width: 42px; height: 42px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; cursor: pointer; transition: transform .2s;
}
.ai-chat-input button:hover { transform: scale(1.1); }

/* Stats Banner */
.stats-banner {
    background: linear-gradient(135deg, var(--p-primary), var(--p-secondary));
    color: #fff; padding: 60px 0;
}
.stats-banner .stat-num {
    font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; margin: 0;
}
.stats-banner .stat-label { opacity: .9; font-size: 1rem; }

/* Hide bottom nav on print */
@media print { .mobile-bottom-nav, .ai-chat-toggle, .ai-chat-box { display: none !important; } }
