/**
 * === Website Builder Public Facing Styles ===
 * Enterprise-quality CSS for website builder public pages
 * Supports RTL/LTR, responsive design, and dynamic branding
 */

/* ============================================
   CSS Variables & Root Styles
   ============================================ */
:root {
    --ws-primary: #004aad;
    --ws-secondary: #0066cc;
    --ws-accent: #ff6b00;
    --ws-background: #ffffff;
    --ws-text: #333333;
    --ws-heading-font: 'Cairo', sans-serif;
    --ws-body-font: 'Cairo', sans-serif;
    /* --ws-direction is intentionally NOT set so body inherits html dir.
       The active culture sets <html dir="rtl|ltr"> server-side; CSS that
       needs the value can read CSS attribute selectors [dir="rtl"] or
       :dir(rtl) for direction-specific overrides. */
    --ws-transition-duration: 0.3s;
    --ws-transition-timing: ease-in-out;
    --ws-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --ws-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --ws-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100vw;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--ws-body-font);
    color: var(--ws-text);
    background-color: var(--ws-background);
    line-height: 1.6;
    /* Inherit direction from <html dir="rtl|ltr"> set per culture. */
    direction: inherit;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ws-heading-font);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 2rem);
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Links */
a {
    color: var(--ws-primary);
    text-decoration: none;
    transition: color var(--ws-transition-duration) var(--ws-transition-timing);
}

a:hover {
    color: var(--ws-accent);
    text-decoration: underline;
}

/* ============================================
   Layout Components
   ============================================ */

/* Navbar */
.navbar {
    box-shadow: var(--ws-shadow-sm);
    z-index: 1030;
    max-width: 100vw;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    transition: color var(--ws-transition-duration) var(--ws-transition-timing);
    margin: 0 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: var(--ws-accent) !important;
}

/* Announcement Bar */
.announcement-bar {
    top: 0;
    width: 100%;
    z-index: 1020;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.website-main {
    flex: 1;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Footer */
.website-footer {
    background-color: var(--ws-primary);
    color: #fff;
    margin-top: auto;
}

.website-footer a {
    color: rgba(255, 255, 255, 0.8);
}

.website-footer a:hover {
    color: var(--ws-accent);
    text-decoration: underline;
}

.website-footer h5 {
    color: #fff;
    margin-bottom: 1rem;
}

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

.website-footer ul li {
    margin-bottom: 0.5rem;
}

/* ============================================
   Section Styles
   ============================================ */

/* Generic Section */
.website-section {
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-secondary) 100%);
    color: #fff;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 500px;
}

.hero-section h1 {
    color: #fff;
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-section .btn {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Features Section */
.features-section {
    background-color: var(--ws-background);
    padding: 4rem 0;
}

.features-section .feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--ws-shadow-sm);
    text-align: center;
    transition: all var(--ws-transition-duration) var(--ws-transition-timing);
}

.features-section .feature-card:hover {
    box-shadow: var(--ws-shadow-lg);
    transform: translateY(-5px);
}

.features-section .feature-icon {
    font-size: 3rem;
    color: var(--ws-primary);
    margin-bottom: 1rem;
}

.features-section .feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--ws-text);
}

.features-section .feature-text {
    color: #666;
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    background-color: #f8f9fa;
    padding: 4rem 0;
}

.contact-section form {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--ws-shadow-md);
}

.contact-section .form-control {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: border-color var(--ws-transition-duration);
}

.contact-section .form-control:focus {
    border-color: var(--ws-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 74, 173, 0.25);
}

.contact-section .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ws-text);
}

/* Content Section */
.content-section {
    background-color: var(--ws-background);
    padding: 3rem 0;
}

.content-section img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--ws-primary) 0%, var(--ws-accent) 100%);
    color: #fff;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.cta-section h2 {
    color: #fff;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
}

.cta-section .btn {
    padding: 0.75rem 2.5rem;
    font-weight: 600;
}

/* ============================================
   Button Styles
   ============================================ */

.btn {
    border-radius: 0.5rem;
    padding: 0.65rem 1.75rem;
    font-weight: 600;
    transition: all var(--ws-transition-duration) var(--ws-transition-timing);
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--ws-shadow-md);
}

.btn:active {
    transform: translateY(0);
}

/* Primary Button */
.btn-primary {
    background-color: var(--ws-primary);
    color: #fff;
    border-color: var(--ws-primary);
}

.btn-primary:hover {
    background-color: var(--ws-secondary);
    border-color: var(--ws-secondary);
    color: #fff;
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--ws-secondary);
    color: #fff;
    border-color: var(--ws-secondary);
}

.btn-secondary:hover {
    background-color: var(--ws-primary);
    border-color: var(--ws-primary);
    color: #fff;
}

/* Accent Button */
.btn-accent {
    background-color: var(--ws-accent);
    color: #fff;
    border-color: var(--ws-accent);
}

.btn-accent:hover {
    background-color: #e55a00;
    border-color: #e55a00;
    color: #fff;
}

/* Light Button */
.btn-light {
    background-color: #fff;
    color: var(--ws-primary);
    border-color: #fff;
}

.btn-light:hover {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
    color: var(--ws-accent);
}

/* Outline Buttons */
.btn-outline-light {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet (768px) */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-section {
        min-height: 400px;
        padding: 3rem 1rem;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .navbar-nav .nav-link {
        margin: 0.25rem 0;
    }

    .website-footer {
        padding: 2rem 1rem;
    }

    .contact-section form {
        padding: 1.5rem;
    }
}

/* Mobile (576px) */
@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .hero-section {
        min-height: 350px;
        padding: 2rem 1rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .hero-section .ws-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .hero-section .row {
        flex-direction: column-reverse;
    }

    .hero-section img {
        margin-bottom: 1.5rem;
    }

    .features-section {
        padding: 2rem 1rem;
    }

    .contact-section form {
        padding: 1rem;
    }

    .website-footer {
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .website-footer .row > div {
        margin-bottom: 1.5rem;
    }
}

/* ============================================
   RTL Support
   ============================================ */

/* RTL handled by Bootstrap 5 RTL CSS — only add custom overrides here */
html[dir="rtl"] .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Utility classes provided by Bootstrap 5 — no duplicates needed */

/* ============================================
   Animation Classes
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   MODERN DESIGN SYSTEM - Enterprise LMS
   Wave Dividers, Glassmorphism, Gradients
   ============================================ */

/* === Wave Dividers === */
.wave-divider {
    position: absolute;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    pointer-events: none;
    z-index: 1;
}

.wave-divider-top {
    top: 0;
    transform: rotate(180deg);
}

.wave-divider-bottom {
    bottom: 0;
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-divider-tall svg {
    height: 100px;
}

.wave-divider-short svg {
    height: 40px;
}

.wave-divider svg path {
    fill: currentColor;
}

/* === Glassmorphism Effects === */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.glass-card-light {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
}

.glass-card-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
}

/* === Gradient Backgrounds === */
.gradient-primary {
    background: linear-gradient(135deg, var(--ws-primary, #004aad) 0%, var(--ws-secondary, #0066cc) 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, var(--ws-primary, #004aad) 0%, color-mix(in srgb, var(--ws-primary, #004aad) 60%, #000) 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, var(--ws-accent, #ff6b00) 0%, color-mix(in srgb, var(--ws-accent, #ff6b00) 70%, var(--ws-primary, #004aad)) 100%);
}

.gradient-radial {
    background: radial-gradient(circle at center, var(--ws-primary, #004aad) 0%, var(--ws-secondary, #0066cc) 100%);
}

.gradient-text {
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === Modern Card Styles === */
.card-modern {
    background: #fff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.card-hover-lift {
    transition: all 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.card-hover-glow {
    transition: all 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(var(--ws-primary-rgb, 0, 74, 173), 0.3);
}

.card-gradient-border {
    position: relative;
    background: #fff;
    border-radius: 16px;
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
    z-index: -1;
}

/* === Section Modern Styling === */
.section-modern {
    position: relative;
    overflow: hidden;
}

.section-content-wrapper {
    position: relative;
    z-index: 2;
}

.section-overlap {
    margin-top: -60px;
    position: relative;
    z-index: 5;
}

.section-lifted {
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 3;
}

.section-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.section-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    pointer-events: none;
}

.section-glow-primary {
    background: var(--ws-primary, #004aad);
}

.section-glow-secondary {
    background: var(--ws-secondary, #0066cc);
}

/* === Feature & Stats Enhancement === */
.feature-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-secondary, #0066cc));
    color: #fff;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 74, 173, 0.25);
    transition: all 0.3s ease;
}

.feature-icon-circle::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover .feature-icon-circle::before {
    opacity: 1;
}

.feature-card:hover .feature-icon-circle {
    transform: scale(1.1);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.stat-counter {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.stat-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* === Testimonial Enhancement === */
.testimonial-card-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.testimonial-card-modern::before {
    content: '"';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 6rem;
    font-family: Georgia, serif;
    color: var(--ws-primary, #004aad);
    opacity: 0.15;
    line-height: 1;
}

[dir="ltr"] .testimonial-card-modern::before {
    right: auto;
    left: 20px;
}

.testimonial-card-modern:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.testimonial-avatar-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
}

.testimonial-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}

/* === Footer Enhancement === */
.footer-gradient {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.footer-links-enhanced a {
    position: relative;
    transition: all 0.3s ease;
    padding-inline-start: 0;
}

.footer-links-enhanced a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--ws-accent, #ff6b00);
    transition: width 0.3s ease;
}

[dir="ltr"] .footer-links-enhanced a::before {
    right: auto;
    left: 0;
}

.footer-links-enhanced a:hover {
    color: var(--ws-accent, #ff6b00) !important;
    padding-inline-start: 8px;
}

.footer-links-enhanced a:hover::before {
    width: 100%;
}

.footer-social-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    margin-inline-end: 0.5rem;
}

.footer-social-icon:hover {
    background: var(--ws-primary, #004aad);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 74, 173, 0.3);
}

/* === Hero Enhancement === */
.hero-content-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-animated-bg {
    background-size: 200% 200%;
    animation: heroGradientFlow 15s ease infinite;
}

@keyframes heroGradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: floatShape 20s ease-in-out infinite;
}

.hero-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.hero-shape:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 10%;
    animation-delay: -5s;
}

.hero-shape:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 40%;
    left: -50px;
    animation-delay: -10s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, 20px) rotate(5deg); }
    50% { transform: translate(0, 40px) rotate(0deg); }
    75% { transform: translate(-20px, 20px) rotate(-5deg); }
}

/* === CTA Section Enhancement === */
.cta-modern {
    position: relative;
    overflow: hidden;
}

.cta-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--ws-primary, #004aad) 0%, color-mix(in srgb, var(--ws-primary, #004aad) 70%, var(--ws-accent, #ff6b00)) 100%);
}

.cta-content {
    position: relative;
    z-index: 2;
}

/* === Pricing Enhancement === */
.pricing-card-featured {
    position: relative;
    transform: scale(1.05);
    z-index: 2;
}

.pricing-card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
    border-radius: 16px 16px 0 0;
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--ws-accent, #ff6b00), color-mix(in srgb, var(--ws-accent, #ff6b00) 70%, var(--ws-primary, #004aad)));
    color: #fff;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

/* === Team Enhancement === */
.team-card-modern {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.team-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-secondary, #0066cc));
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.team-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.team-card-modern:hover::before {
    opacity: 0.2;
}

.team-avatar-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--ws-primary, #004aad), var(--ws-accent, #ff6b00));
    position: relative;
    z-index: 1;
}

.team-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}

.team-social-links {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.team-card-modern:hover .team-social-links {
    opacity: 1;
    transform: translateY(0);
}

/* === Gallery Enhancement === */
.gallery-item-modern {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.gallery-item-modern img {
    transition: transform 0.5s ease;
}

.gallery-item-modern:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item-modern:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    color: #fff;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-item-modern:hover .gallery-caption {
    transform: translateY(0);
}

/* === Animation Utilities === */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

.stagger-item {
    transition-delay: calc(var(--stagger-index, 0) * 100ms);
}

/* === Responsive Adjustments === */
@media (max-width: 991.98px) {
    .feature-icon-circle {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
    
    .stat-counter {
        font-size: 2.5rem;
    }
    
    .hero-content-glass {
        padding: 2rem;
    }
    
    .pricing-card-featured {
        transform: scale(1);
    }
    
    .team-avatar-wrapper {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 767.98px) {
    .wave-divider svg {
        height: 40px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .glass-card {
        padding: 1.25rem;
    }
    
    .hero-shape {
        display: none;
    }
    
    .stat-counter {
        font-size: 2rem;
    }
    
    .testimonial-card-modern {
        padding: 1.5rem;
    }
    
    .testimonial-card-modern::before {
        font-size: 4rem;
    }
}

/* ============================================
   Enterprise Section Components — Phase 1
   Blog Grid, Testimonials Bento, Gallery Masonry,
   Hero Parallax, WhatsApp Float, Announcement Bar,
   Pricing Toggle, Enhanced Animations
   ============================================ */

/* --- WhatsApp Floating Button --- */
.ws-whatsapp-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    font-size: 1.5rem;
    animation: wsWhatsappPulse 2s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir="ltr"] .ws-whatsapp-float {
    left: auto;
    right: 24px;
}

.ws-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

@keyframes wsWhatsappPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.6), 0 0 0 8px rgba(37, 211, 102, 0.1); }
}

/* --- Announcement Bar --- */
.ws-announcement-bar {
    position: sticky;
    top: 0;
    z-index: 1050;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, var(--ws-primary), var(--ws-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ws-announcement-bar .close-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

html[dir="ltr"] .ws-announcement-bar .close-btn {
    right: auto;
    left: 1rem;
}

.ws-announcement-bar .close-btn:hover {
    color: #fff;
}

/* --- Hero Parallax Background --- */
.ws-hero-parallax {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

@supports not (background-attachment: fixed) {
    .ws-hero-parallax {
        background-attachment: scroll;
    }
}

/* --- Enhanced Hero Floating Shapes (Login Page DNA) --- */
.hero-floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
}

.hero-shape:nth-child(1) {
    width: 350px;
    height: 350px;
    top: -10%;
    right: -5%;
    animation: floatShape 20s ease-in-out infinite;
}

.hero-shape:nth-child(2) {
    width: 250px;
    height: 250px;
    bottom: -5%;
    left: 10%;
    animation: floatShape 18s ease-in-out infinite reverse;
}

.hero-shape:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 40%;
    left: 50%;
    animation: floatShape 22s ease-in-out infinite 3s;
}

/* --- Hero Animated Background Gradient --- */
.hero-animated-bg {
    background-size: 400% 400%;
    animation: heroGradientFlow 15s ease infinite;
}

/* --- Pricing Toggle (Monthly/Yearly) --- */
.ws-pricing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem;
    background: #f1f5f9;
    border-radius: 30px;
    margin-bottom: 2rem;
}

.ws-pricing-toggle-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--ws-body-font);
}

.ws-pricing-toggle-btn.active {
    background: var(--ws-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 74, 173, 0.25);
}

/* --- Enhanced Card Hover: Gradient Border Reveal --- */
.card-gradient-border-hover {
    position: relative;
    z-index: 0;
}

.card-gradient-border-hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, var(--ws-primary), var(--ws-accent), var(--ws-secondary), var(--ws-primary));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-gradient-border-hover:hover::before {
    opacity: 1;
}

/* --- Feature Icon Rotation on Hover --- */
.card-hover-lift .feature-icon-circle {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover-lift:hover .feature-icon-circle {
    transform: rotateY(180deg);
}

/* --- Team Social Links Slide-Up --- */
.team-card-modern .team-social-links {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card-modern:hover .team-social-links {
    opacity: 1;
    transform: translateY(0);
}

/* --- Navbar Glassmorphism Scroll Behavior --- */
.navbar.navbar-scrolled {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* --- Spring Easing Override (Login Page DNA) --- */
.card-hover-lift,
.feature-icon-circle,
.glass-card,
.glass-card-light,
.testimonial-card-modern,
.stat-card,
.gallery-item-modern,
.team-card-modern,
.pricing-card-featured,
.ws-blog-card,
.ws-testimonial-bento-item,
.ws-gallery-masonry-item img,
.ws-gallery-filter-btn,
.btn {
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Enhanced Section Divider Waves --- */
.ws-section-divider {
    position: relative;
    margin-top: -1px;
    margin-bottom: -1px;
    line-height: 0;
}

.ws-section-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* --- Reduced Motion: Comprehensive Disable --- */
@media (prefers-reduced-motion: reduce) {
    .hero-shape,
    .hero-animated-bg,
    .ws-whatsapp-float,
    .ws-blog-card,
    .ws-testimonial-bento-item,
    .ws-gallery-masonry-item img,
    .card-hover-lift .feature-icon-circle,
    .card-gradient-border-hover::before {
        animation: none !important;
        transition: none !important;
    }
}

/* --- Responsive: Enterprise Grid Adjustments --- */
@media (max-width: 991.98px) {
    .hero-shape:nth-child(1) { width: 250px; height: 250px; }
    .hero-shape:nth-child(2) { width: 180px; height: 180px; }
    .hero-shape:nth-child(3) { display: none; }
}

@media (max-width: 767.98px) {
    .hero-floating-shapes .hero-shape {
        filter: blur(40px);
        opacity: 0.4;
    }
    .hero-shape:nth-child(1) { width: 180px; height: 180px; }
    .hero-shape:nth-child(2) { width: 120px; height: 120px; }
    .ws-whatsapp-float { width: 48px; height: 48px; bottom: 16px; left: 16px; }
    html[dir="ltr"] .ws-whatsapp-float { left: auto; right: 16px; }
    .ws-announcement-bar { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
}

@media (max-width: 575.98px) {
    .ws-pricing-toggle { flex-direction: column; gap: 0.25rem; border-radius: 16px; }
    .ws-pricing-toggle-btn { width: 100%; }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    body {
        background-color: #fff;
    }

    .navbar,
    .announcement-bar,
    .website-footer {
        display: none;
    }

    main {
        box-shadow: none;
    }
}

/* ============================================
   Website Builder — Production Utility Classes
   ============================================ */

/* ── Testimonial Bento Cards ── */
.ws-t-card {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    border: 1px solid #eef2f7;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease;
}
.ws-t-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,.1);
}
.ws-t-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

/* ── Stats Strip Counter Cards ── */
.ws-stat-strip-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 16px;
    transition: all .3s cubic-bezier(.16,1,.3,1);
}
.ws-stat-strip-card:hover {
    transform: translateY(-4px);
}
.ws-stat-strip-num {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ws-stat-strip-lbl {
    font-size: .85rem;
    margin-top: .35rem;
    opacity: .8;
}

/* ── Categories Section Cards ── */
.ws-category-card {
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    height: 100%;
    transition: all .35s cubic-bezier(.16,1,.3,1);
    position: relative;
    overflow: hidden;
}
.ws-category-card:hover {
    background: rgba(255,255,255,.14);
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(0,0,0,.25);
}
.ws-category-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    background: rgba(255,255,255,.15);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.ws-category-card:hover .ws-category-icon-circle {
    transform: scale(1.1) rotate(-6deg);
}

/* ── Video Poster Section ── */
.ws-video-section {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ws-play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .3s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 0 0 0 rgba(255,255,255,.4);
    animation: ws-pulse 2.5s infinite;
}
.ws-play-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 16px rgba(255,255,255,.0);
    animation: none;
}
@keyframes ws-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(255,255,255,.5); }
    70%  { box-shadow: 0 0 0 18px rgba(255,255,255,.0); }
    100% { box-shadow: 0 0 0 0   rgba(255,255,255,.0); }
}

/* ── Feature Split Mini Cards ── */
.ws-feature-mini-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid #eef2f7;
    height: 100%;
    transition: all .3s cubic-bezier(.16,1,.3,1);
}
.ws-feature-mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,.1);
}

/* ── Counter Animation Base ── */
[data-ws-counter] {
    display: inline-block;
}
[data-ws-counter].ws-counter-done {
    transition: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   Per-section color overrides — قيم CSS لكل قسم
   Admins can pick custom colors per section from the inspector Design tab.
   Each override sets a --ws-section-* custom property on the <section>
   wrapper (see WebsiteRenderingService.AppendSectionColorVar). These rules
   make the children consume those overrides while falling back to the
   page-level theme tokens (--ws-text, --ws-primary, --ws-accent, …).
   The [style*="--ws-section-..."] attribute selector scopes each rule so
   it ONLY applies when the admin explicitly set that variable on this
   section (otherwise existing theme styles win). !important ensures the
   admin's explicit choice overrides high-specificity theme defaults
   (e.g. .ws-section-hero p { color: #fff; }).
   ────────────────────────────────────────────────────────────────────────── */
section.website-section[style*="--ws-section-text"],
section.website-section[style*="--ws-section-text"] p,
section.website-section[style*="--ws-section-text"] li,
section.website-section[style*="--ws-section-text"] .lead,
section.website-section[style*="--ws-section-text"] .ws-text,
section.website-section[style*="--ws-section-text"] .hero-body,
section.website-section[style*="--ws-section-text"] .section-body,
section.website-section[style*="--ws-section-text"] .ws-hero-body,
section.website-section[style*="--ws-section-text"] .text-muted {
    color: var(--ws-section-text) !important;
}

section.website-section[style*="--ws-section-heading"] h1,
section.website-section[style*="--ws-section-heading"] h2,
section.website-section[style*="--ws-section-heading"] h3,
section.website-section[style*="--ws-section-heading"] h4,
section.website-section[style*="--ws-section-heading"] h5,
section.website-section[style*="--ws-section-heading"] h6,
section.website-section[style*="--ws-section-heading"] .ws-section-heading,
section.website-section[style*="--ws-section-heading"] .section-title,
section.website-section[style*="--ws-section-heading"] .ws-hero-title,
section.website-section[style*="--ws-section-heading"] .display-1,
section.website-section[style*="--ws-section-heading"] .display-2,
section.website-section[style*="--ws-section-heading"] .display-3,
section.website-section[style*="--ws-section-heading"] .display-4,
section.website-section[style*="--ws-section-heading"] .display-5,
section.website-section[style*="--ws-section-heading"] .display-6 {
    color: var(--ws-section-heading) !important;
}

section.website-section[style*="--ws-section-accent"] .ws-accent,
section.website-section[style*="--ws-section-accent"] .text-accent,
section.website-section[style*="--ws-section-accent"] .ws-section-accent,
section.website-section[style*="--ws-section-accent"] .ws-hero-accent,
section.website-section[style*="--ws-section-accent"] .section-eyebrow,
section.website-section[style*="--ws-section-accent"] .badge {
    color: var(--ws-section-accent) !important;
}

section.website-section[style*="--ws-section-btn-bg"] .btn-primary,
section.website-section[style*="--ws-section-btn-bg"] .ws-btn-primary,
section.website-section[style*="--ws-section-btn-bg"] .ws-cta-primary,
section.website-section[style*="--ws-section-btn-bg"] button.btn-primary {
    background-color: var(--ws-section-btn-bg) !important;
    border-color: var(--ws-section-btn-bg) !important;
}
section.website-section[style*="--ws-section-btn-text"] .btn-primary,
section.website-section[style*="--ws-section-btn-text"] .ws-btn-primary,
section.website-section[style*="--ws-section-btn-text"] .ws-cta-primary,
section.website-section[style*="--ws-section-btn-text"] button.btn-primary {
    color: var(--ws-section-btn-text) !important;
}
section.website-section[style*="--ws-section-btn-bg"] .btn-primary:hover,
section.website-section[style*="--ws-section-btn-bg"] .ws-btn-primary:hover,
section.website-section[style*="--ws-section-btn-bg"] .ws-cta-primary:hover {
    filter: brightness(.92);
}

section.website-section[style*="--ws-section-btn-bg"] .btn-outline-primary,
section.website-section[style*="--ws-section-btn-bg"] .ws-btn-secondary {
    border-color: var(--ws-section-btn-bg) !important;
    color: var(--ws-section-btn-bg) !important;
}
section.website-section[style*="--ws-section-btn-bg"] .btn-outline-primary:hover,
section.website-section[style*="--ws-section-btn-bg"] .ws-btn-secondary:hover {
    background-color: var(--ws-section-btn-bg) !important;
    color: var(--ws-section-btn-text, #fff) !important;
}

section.website-section[style*="--ws-section-card-bg"] .ws-card,
section.website-section[style*="--ws-section-card-bg"] .feature-card,
section.website-section[style*="--ws-section-card-bg"] .ws-feature-card,
section.website-section[style*="--ws-section-card-bg"] .ws-feature-mini-card,
section.website-section[style*="--ws-section-card-bg"] .pricing-card,
section.website-section[style*="--ws-section-card-bg"] .testimonial-card,
section.website-section[style*="--ws-section-card-bg"] .ws-team-card,
section.website-section[style*="--ws-section-card-bg"] .ws-stat-card,
section.website-section[style*="--ws-section-card-bg"] .ws-blog-card,
section.website-section[style*="--ws-section-card-bg"] .ws-faq-item,
section.website-section[style*="--ws-section-card-bg"] .ws-course-card {
    background-color: var(--ws-section-card-bg) !important;
}
section.website-section[style*="--ws-section-card-border"] .ws-card,
section.website-section[style*="--ws-section-card-border"] .feature-card,
section.website-section[style*="--ws-section-card-border"] .ws-feature-card,
section.website-section[style*="--ws-section-card-border"] .ws-feature-mini-card,
section.website-section[style*="--ws-section-card-border"] .pricing-card,
section.website-section[style*="--ws-section-card-border"] .testimonial-card,
section.website-section[style*="--ws-section-card-border"] .ws-team-card,
section.website-section[style*="--ws-section-card-border"] .ws-stat-card,
section.website-section[style*="--ws-section-card-border"] .ws-blog-card,
section.website-section[style*="--ws-section-card-border"] .ws-faq-item,
section.website-section[style*="--ws-section-card-border"] .ws-course-card {
    border-color: var(--ws-section-card-border) !important;
}

section.website-section[style*="--ws-section-icon"] .ws-icon,
section.website-section[style*="--ws-section-icon"] .feature-icon,
section.website-section[style*="--ws-section-icon"] .ws-feature-icon,
section.website-section[style*="--ws-section-icon"] .section-icon,
section.website-section[style*="--ws-section-icon"] .ws-stat-icon,
section.website-section[style*="--ws-section-icon"] i.fa,
section.website-section[style*="--ws-section-icon"] i.fas,
section.website-section[style*="--ws-section-icon"] i.far,
section.website-section[style*="--ws-section-icon"] i.fab,
section.website-section[style*="--ws-section-icon"] i.feather,
section.website-section[style*="--ws-section-icon"] svg.feather,
section.website-section[style*="--ws-section-icon"] i.bi {
    color: var(--ws-section-icon) !important;
}
section.website-section[style*="--ws-section-icon"] svg.feather {
    stroke: var(--ws-section-icon) !important;
}
