/* ========== App Theme after Landing (Image 2) ========== */
:root {
    --zarila-pink: #ec4899;
    --zarila-pink-light: #f472b6;
    --zarila-purple: #a855f7;
    --zarila-bg: #05050a;
    --zarila-surface: rgba(255, 255, 255, 0.03);
    --zarila-border: rgba(236, 72, 153, 0.2);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--zarila-bg);
    color: #f5f5f5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Main Layout with Zarila theme */
.main-layout {
    min-height: 100vh;
    position: relative;
    background: #05050a;
    overflow: hidden;
}

/* Background orbs inspired by image 2 */
.main-layout::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    background: 
        radial-gradient(circle at 70% 40%, rgba(236, 72, 153, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 35%),
        radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.main-layout::after {
    content: 'zarila';
    position: fixed;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8rem;
    font-weight: 300;
    font-style: italic;
    color: rgba(236, 72, 153, 0.18);
    letter-spacing: -0.02em;
    pointer-events: none;
    z-index: 0;
    text-shadow: 0 0 40px rgba(236, 72, 153, 0.3);
}

/* Floating orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f472b6, #ec4899 60%, transparent 70%);
    filter: blur(1px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.5);
}

.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(5, 5, 10, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--zarila-border);
}

.main-header .logo {
    font-weight: 700;
    font-size: 1.3rem;
    background: linear-gradient(90deg, #f472b6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-body {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Auth layout also uses the same dark theme */
.auth-layout {
    min-height: 100vh;
    background: #05050a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 80% 30%, rgba(236, 72, 153, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 20% 70%, rgba(168, 85, 247, 0.12) 0%, transparent 35%);
    pointer-events: none;
}

/* =========================================================
   SHARED PAGE / CARDS / AUTH / ADMIN
========================================================= */

.page-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    color: #fff;
}

.page-header {
    margin-bottom: 2rem;
}

.page-eyebrow {
    color: #e879f9;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.page-header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
}

.page-lead {
    color: #a1a1aa;
    margin: 0;
    line-height: 1.7;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    border-radius: 1.25rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(236, 72, 153, 0.2);
    box-shadow: 0 16px 40px rgba(0,0,0,0.28);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: rgba(236, 72, 153, 0.45);
    box-shadow: 0 22px 50px rgba(236, 72, 153, 0.18);
}

.article-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111;
}

.article-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.article-card:hover .article-card-media img {
    transform: scale(1.06);
}

.article-card-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(5,5,10,0.15), rgba(5,5,10,0.75));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover .article-card-overlay {
    opacity: 1;
}

.article-card-overlay span {
    padding: 0.65rem 1.2rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.45);
}

.article-card-body {
    padding: 1.1rem 1.15rem 1.25rem;
}

.article-card-body h2 {
    margin: 0 0 0.45rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.article-card-body p {
    margin: 0;
    color: #a1a1aa;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-detail-hero {
    border-radius: 1.25rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.article-detail-hero img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 520px;
    object-fit: cover;
}

.article-detail-header {
    margin-bottom: 1.5rem;
}

.article-detail-content {
    color: #d4d4d8;
    line-height: 1.9;
    font-size: 1.05rem;
}

.article-detail-content p {
    margin: 0 0 1.1rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #c4b5fd;
    text-decoration: none;
}

.auth-gate-card {
    max-width: 420px;
    margin: 3rem auto;
    padding: 2rem;
    text-align: center;
    border-radius: 1.25rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.btn-primary-link,
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem;
    padding: 0.85rem 1.4rem;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

.btn-submit {
    width: 100%;
}

.contact-card,
.admin-panel,
.auth-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(236, 72, 153, 0.22);
    border-radius: 1.25rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #d4d4d8;
}

.form-input,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(236, 72, 153, 0.3);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #ec4899;
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.7;
}

.form-error {
    color: #fb7185;
    font-size: 0.9rem;
}

.success-banner {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    margin-bottom: 1rem;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
    padding: 1rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    background: rgba(0,0,0,0.25);
    padding: 0.35rem;
    border-radius: 9999px;
}

.auth-tabs button {
    border: none;
    background: transparent;
    color: #a1a1aa;
    padding: 0.65rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
}

.auth-tabs button.active {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
}

.auth-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.6rem;
    background: linear-gradient(90deg, #f472b6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-sub,
.auth-hint {
    color: #a1a1aa;
    font-size: 0.9rem;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.admin-tabs button {
    border: 1px solid rgba(236, 72, 153, 0.25);
    background: rgba(255,255,255,0.03);
    color: #e9d5ff;
    padding: 0.55rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
}

.admin-tabs button.active {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    border-color: transparent;
    color: #fff;
}

.admin-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.admin-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-list-title {
    margin-top: 2rem;
}

.btn-danger {
    border: none;
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    cursor: pointer;
}

.messages-list li {
    display: block;
}

.messages-list p {
    margin: 0.4rem 0;
    color: #d4d4d8;
}

@media (max-width: 640px) {
    .page-shell {
        padding: 1.25rem 1rem 3rem;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }
}

/* Messages / admin reply */
.messages-toolbar { margin-bottom: 1.25rem; }
.message-thread-list { display: flex; flex-direction: column; gap: 1.25rem; }
.message-thread {
    padding: 1.1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(236, 72, 153, 0.2);
    background: rgba(255,255,255,0.03);
}
.message-thread.has-unread {
    border-color: rgba(236, 72, 153, 0.55);
    box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.25);
}
.message-bubble {
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    margin-bottom: 0.65rem;
}
.user-bubble {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
}
.admin-bubble {
    background: rgba(236, 72, 153, 0.12);
    border: 1px solid rgba(236, 72, 153, 0.28);
}
.bubble-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    color: #c4b5fd;
}
.message-bubble p { margin: 0; line-height: 1.7; color: #e4e4e7; }
.awaiting-reply { color: #a1a1aa; font-size: 0.9rem; margin: 0.25rem 0 0; }
.admin-message-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.admin-message-card {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
}
.admin-message-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.admin-message-head .muted { color: #a1a1aa; font-weight: 400; }
.reply-box { margin-top: 0.75rem; }
.reply-btn { width: auto; margin-top: 0.5rem; padding-inline: 1.4rem; }

.file-input {
    padding: 0.55rem;
    cursor: pointer;
}
.field-hint {
    display: block;
    margin: 0.35rem 0 0.5rem;
    color: #a1a1aa;
    font-size: 0.8rem;
}
.image-preview {
    margin-top: 0.65rem;
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid rgba(236, 72, 153, 0.25);
    max-width: 280px;
}
.image-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
}

/* Mixed Persian + English (BiDi) */
.bidi-text {
    unicode-bidi: plaintext;
    text-align: start;
    line-height: 1.9;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.article-detail-content {
    max-width: 48rem;
    margin: 0 auto;
}

.article-detail-content p.bidi-text {
    margin: 0 0 1.1rem;
    white-space: pre-wrap;
}

.article-detail-hero {
    width: 100%;
    border-radius: 1.25rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.04);
    min-height: 180px;
}

.article-detail-hero img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.article-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    align-items: center;
}
.chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
    font-size: 0.75rem;
}
.meta-date, .meta-stats {
    display: block;
    color: #a1a1aa;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}
.social-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 1.25rem 0;
    flex-wrap: wrap;
}
.react-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 0.75rem;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
}
.react-btn.active {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.2);
}
.comments-section { margin-top: 1.5rem; }
.comment-item {
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    border-radius: 0.85rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.link-btn {
    background: none;
    border: none;
    color: #c4b5fd;
    cursor: pointer;
    padding: 0;
    margin-top: 0.35rem;
    margin-left: 0.75rem;
}
.link-btn.danger { color: #fca5a5; }
.msg-actions { margin-top: 0.35rem; }
.mention-tag { color: #f9a8d4; }

/* Language switcher */
.lang-switch { position: relative; display: inline-flex; }
.lang-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(196,181,253,0.35);
    background: rgba(255,255,255,0.06);
    cursor: pointer; display: grid; place-items: center;
    padding: 0; transition: background .2s, transform .2s;
}
.lang-btn:hover { background: rgba(168,85,247,0.2); transform: scale(1.05); }
.lang-flag { font-size: 1.15rem; line-height: 1; }
.lang-dropdown {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0;
    min-width: 150px; padding: 0.4rem;
    background: #14141f; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.85rem; box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    z-index: 100; display: flex; flex-direction: column; gap: 0.25rem;
}
.lang-option {
    display: flex; align-items: center; gap: 0.5rem;
    background: transparent; border: none; color: #e9d5ff;
    padding: 0.5rem 0.65rem; border-radius: 0.55rem;
    cursor: pointer; font-size: 0.9rem; text-align: start;
}
.lang-option:hover, .lang-option.active { background: rgba(168,85,247,0.22); }

.nav-brand-cluster, .logo-cluster {
    display: flex; align-items: center; gap: 0.65rem;
    justify-self: start;
}

/* About / resume */
.about-section { margin: 2rem 0 2.5rem; }
.about-section-title {
    font-size: 1.25rem; margin: 0 0 1rem;
    color: #e9d5ff; font-weight: 700;
}
.about-timeline { display: flex; flex-direction: column; gap: 1rem; }
.about-card {
    display: grid; grid-template-columns: auto 1fr; gap: 1rem;
    padding: 1rem 1.15rem; border-radius: 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.about-card-media {
    width: 72px; height: 72px; border-radius: 1rem; overflow: hidden;
    background: rgba(168,85,247,0.15);
}
.about-card-media img { width: 100%; height: 100%; object-fit: cover; }
.about-card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; margin-bottom: 0.35rem; }
.about-period { color: #f9a8d4; font-size: 0.82rem; font-weight: 600; }
.about-loc { color: #a1a1aa; font-size: 0.82rem; }
.about-company { color: #c4b5fd; margin: 0.15rem 0 0.45rem; font-size: 0.92rem; }
.about-body { color: #d4d4d8; margin: 0; line-height: 1.7; }
@media (max-width: 600px) {
    .about-card { grid-template-columns: 1fr; }
}

html[dir="ltr"] body, body.is-ltr { direction: ltr; text-align: start; }
html[dir="rtl"] body, body.is-rtl { direction: rtl; text-align: start; }
