/* ===== Base & Layout ===== */

:root {
    --bg-body: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-surface-soft: #f1f4fb;
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --primary-dark: #1d4ed8;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --radius-lg: 18px;
    --radius-md: 10px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.07);
    --shadow-subtle: 0 10px 25px rgba(15, 23, 42, 0.05);
    --error: #b91c1c;
    --success: #166534;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e0ebff 0, #f5f7fb 38%, #f9fafb 100%);
    color: var(--text-main);

    opacity: 0;
    animation: pageFadeIn 0.6s ease-out forwards;
}

/* Default language is Arabic */
html[dir="rtl"] body {
    direction: rtl;
}

/* When toggled to English */
body.is-ltr {
    direction: ltr;
}

/* ===== Animations ===== */

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animate {
    opacity: 0;
    transform: translateY(10px);
    animation: cardRise 0.55s ease-out forwards;
}

.card-animate-delay {
    animation-delay: 0.15s;
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Reusable layout helpers ===== */

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Header ===== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 247, 251, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 16px;
}

/* Brand with ear icon + badge */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(245, 247, 251, 0.96); /* match header tone */
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.brand-icon {
    height: 22px;      /* not forced square */
    width: auto;
    object-fit: contain;
    opacity: 0.9;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.92rem;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--primary-dark);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Nav */

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    position: relative;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 999px;
    transform: translateX(-50%);
    transition: width 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link:hover::after {
    width: 70%;
}

.nav-link.active {
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-link.active::after {
    width: 70%;
}

.header-ctas {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Language toggle button */
.btn-lang {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(37, 99, 235, 0.22);
    color: var(--primary-dark);
    position: relative;
    overflow: hidden;
}

.btn-lang::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 180deg, rgba(37, 99, 235, 0.0), rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.0));
    animation: spinGlow 2.4s linear infinite;
    opacity: 0.9;
}

.btn-lang::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
}

.btn-lang .lang-pill {
    position: relative;
    z-index: 1;
    display: inline-flex;
    gap: 8px;
}

.btn-lang:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-subtle);
}

.btn-lang.pop {
    animation: pop 0.32s ease-out;
}

@keyframes spinGlow {
    to { transform: rotate(360deg); }
}

@keyframes pop {
    0% { transform: scale(1); }
    55% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* Language switch animation for the whole page */
body.lang-switching main,
body.lang-switching header {
    animation: langSwap 0.55s ease;
}

@keyframes langSwap {
    0% { opacity: 1; transform: translateY(0); filter: blur(0px); }
    45% { opacity: 0.25; transform: translateY(6px); filter: blur(1px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0px); }
}

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.08s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-dark);
    border-color: rgba(37, 99, 235, 0.2);
}

.btn-outline:hover {
    background: var(--primary-soft);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: var(--shadow-subtle);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

/* ===== Hero (Home) ===== */

.hero {
    padding: 40px 0 60px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 28px;
    align-items: center;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--primary-dark);
    margin: 0 0 6px;
}

.hero-text h1 {
    font-size: clamp(2rem, 4vw, 2.6rem);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.hero-lead,
.hero-text p {
    margin: 0 0 20px;
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.6;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.hero-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.highlight {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 12px 12px 10px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.04);
}

.highlight-title {
    font-size: 0.78rem;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.highlight-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Hero side panel */

.hero-panel {
    display: flex;
    justify-content: center;
}

.hero-card {
    width: 100%;
    max-width: 360px;
    background: radial-gradient(circle at top, #e0edff 0, #ffffff 45%);
    border-radius: var(--radius-lg);
    padding: 22px 22px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(209, 213, 219, 0.9);
}

.hero-card h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.hero-card p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.hero-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-main);
}

.hero-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
}

.hero-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

/* ===== Page Header ===== */

.page-header {
    padding: 34px 0 10px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 1.7rem;
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    max-width: 580px;
}

/* ===== About Page ===== */

.about-section {
    padding: 10px 0 50px;
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 26px;
}

.about-text h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.about-text p {
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

.about-text h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 1rem;
}

.bullet-list {
    margin: 0 0 6px;
    padding-left: 18px;
    color: var(--text-main);
    font-size: 0.92rem;
}

.bullet-list li {
    margin-bottom: 4px;
}

/* Profile photo */

.profile-photo-container {
    width: 160px;
    height: 160px;
    margin-bottom: 16px;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

/* Sidebar */

.about-side-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
}

.about-side-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.info-list li {
    margin-bottom: 6px;
}

.about-cta-box {
    border-radius: var(--radius-md);
    background: var(--bg-surface-soft);
    border: 1px dashed rgba(148, 163, 184, 0.6);
    padding: 12px 12px 10px;
}

.about-cta-box p {
    margin: 0 0 10px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

/* ===== Reviews Page ===== */

.review-page {
    padding-bottom: 40px;
}

.review-section {
    padding: 10px 0 50px;
}

.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
}

.review-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px 20px 18px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
}

.review-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.review-intro {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Form */

.review-form {
    margin-top: 6px;
}

.form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.field-group {
    flex: 1;
    min-width: 160px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4b5563;
}

.form-control,
.select-control,
.textarea-control {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    padding: 8px 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #f9fafb;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        transform 0.08s ease;
}

.form-control:focus,
.select-control:focus,
.textarea-control:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
    background: #ffffff;
    transform: translateY(-1px);
}

.textarea-control {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* Status message */

.status-message {
    font-size: 0.82rem;
    color: var(--success);
}

.status-message.error {
    color: var(--error);
}

/* Review list */

.reviews-list-card {
    max-height: 520px;
    overflow-y: auto;
}

.reviews-list {
    margin-top: 8px;
}

.review-item {
    border-radius: 14px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    padding: 10px 12px 8px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), #ffffff);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.review-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.review-name {
    font-weight: 600;
}

.rating-stars {
    font-size: 0.78rem;
    color: #f59e0b;
}

.review-comment {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.empty-state {
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ===== Powered-by badge ===== */

.powered-by {
    position: fixed;
    bottom: 14px;
    left: 14px;
    z-index: 60;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.02);
    color: #4b5563;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease;
}

/* Codifica logo: non-square, keeps aspect */
.powered-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
}

.powered-by:hover {
    background: #111827;
    color: #f9fafb;
    border-color: transparent;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
    transform: translateY(-1px);
}

/* ===== Responsiveness ===== */

@media (max-width: 900px) {
    .hero-grid,
    .about-grid,
    .review-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-panel {
        order: -1;
    }

    .hero-card {
        max-width: 100%;
    }

    .hero-highlights {
        grid-template-columns: minmax(0, 1fr);
    }

    .reviews-list-card {
        max-height: none;
    }
}

@media (max-width: 720px) {
    .header-content {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .header-ctas {
        margin-left: auto;
    }

    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .hero-ctas {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-ctas {
        width: 100%;
        justify-content: flex-end;
    }

    .header-ctas .btn {
        padding-inline: 14px;
    }

    .powered-by {
        bottom: 10px;
        left: 10px;
        padding-inline: 10px;
    }
}
.powered-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;         /* smooth rounded logo */
    background: none;           /* ensures no extra white frame */
    display: block;
    opacity: 0.92;
}

/* ===== Info posts page ===== */

.posts-section {
    padding: 8px 0 44px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.post-card {
    background: var(--bg-surface);
    border: 1px solid rgba(229, 231, 235, 0.75);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
}

.post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-surface-soft);
}

.post-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-title {
    margin: 0;
    font-size: 1.05rem;
}

.post-text {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.post-link {
    margin-top: auto;
    display: inline-flex;
    align-self: flex-start;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.85);
    transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.post-link:hover {
    transform: translateY(-1px);
    background: var(--primary-soft);
    box-shadow: var(--shadow-subtle);
}

@media (max-width: 520px) {
    .post-image {
        height: 160px;
    }
}

/* ===== Post detail page ===== */

.post-detail {
    padding: 10px 0 44px;
}

.post-back {
    display: inline-flex;
    margin: 10px 0 14px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.85);
    transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.post-back:hover {
    transform: translateY(-1px);
    background: var(--primary-soft);
    box-shadow: var(--shadow-subtle);
}

.post-detail-card {
    background: var(--bg-surface);
    border: 1px solid rgba(229, 231, 235, 0.75);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}

.post-detail-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    background: var(--bg-surface-soft);
}

.post-detail-body {
    padding: 16px 16px 18px;
}

.post-detail-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.35;
}

.post-detail-meta {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.post-detail-content {
    margin-top: 14px;
    color: var(--text-body);
    line-height: 1.9;
}

.post-detail-content p {
    margin: 0 0 12px;
}

.post-detail-content ul {
    margin: 10px 0 12px;
    padding-inline-start: 18px;
}

@media (max-width: 520px) {
    .post-detail-image {
        height: 200px;
    }
    .post-detail-title {
        font-size: 1.2rem;
    }
}
