/*
 Theme Name:   generatepress-child
 Theme URI:    https://khiyaramal.com/
 Description:  GeneratePress child theme for the Egypt Storefront project.
 Author:       Egypt Storefront
 Template:     generatepress
 Version:      1.0.0
 Text Domain:  egypt-storefront
*/

/* ========================================
   Egypt Storefront - Design System
   Theme: Egyptian (Gold, Lapis Lazuli, Sand)
   Supports: LTR (EN) & RTL (AR)
   ======================================== */

/* --- CSS Variables --- */
:root {
    /* Egyptian Palette */
    --gold: #D4A843;
    --gold-light: #F0D78C;
    --gold-dark: #B8862D;
    --lapis: #1E3A5F;
    --lapis-dark: #0F2440;
    --lapis-light: #2E5A8A;
    --sand: #F5E6C8;
    --sand-light: #FDF5E6;
    --sand-dark: #D4C4A8;
    --terracotta: #A0522D;
    --papyrus: #F5F0E8;
    --night: #0A1628;
    
    /* Functional Colors */
    --bg-primary: var(--sand-light);
    --bg-secondary: var(--papyrus);
    --bg-card: #FFFFFF;
    --bg-header: var(--lapis-dark);
    --bg-chat: #F8F4EC;
    --text-primary: #1A1A1A;
    --text-secondary: #5C5C5C;
    --text-light: #FFFFFF;
    --text-muted: #8C8C8C;
    --accent: var(--gold);
    --accent-hover: var(--gold-dark);
    --border: #E0D5C5;
    --success: #2E7D32;
    --error: #C62828;
    --shadow: rgba(30, 58, 95, 0.1);
    --shadow-hover: rgba(30, 58, 95, 0.2);
    
    /* Typography */
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-ar: 'Cairo', 'Segoe UI', sans-serif;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition: 0.3s ease;
}

/* --- RTL Overrides --- */
[dir="rtl"] {
    --font-primary: var(--font-ar);
    text-align: right;
}

[dir="rtl"] .egypt-header-inner {
    flex-direction: row;
    direction: ltr;
}

[dir="rtl"] html {
    overflow-x: hidden;
}

[dir="rtl"] body {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden;
    max-width: 100vw;
}

[dir="ltr"] {
    --font-primary: var(--font-en);
    text-align: left;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-en);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* --- Header --- */
.egypt-header {
    background: linear-gradient(135deg, var(--lapis-dark) 0%, var(--lapis) 100%);
    color: var(--text-light);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow);
    border-bottom: 3px solid var(--gold);
}

.egypt-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.egypt-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-light);
}

.egypt-logo:hover {
    color: var(--text-light);
}

.egypt-logo-icon {
    font-size: 32px;
    line-height: 1;
}

.egypt-logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.egypt-logo-text span {
    color: var(--gold);
}

.egypt-logo-subtitle {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.egypt-header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* --- Language Switcher --- */
.egypt-lang-switch {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.egypt-lang-btn {
    font-family: var(--font-en);
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.egypt-lang-btn.active {
    background: var(--gold);
    color: var(--lapis-dark);
    font-weight: 600;
}

.egypt-lang-btn:hover:not(.active) {
    color: var(--text-light);
    background: rgba(255,255,255,0.1);
}

/* --- Footer --- */
.egypt-footer {
    background: var(--lapis-dark);
    color: var(--text-light);
    text-align: center;
    padding: 20px 24px;
    font-size: 13px;
    opacity: 0.8;
    border-top: 2px solid var(--gold);
}

.egypt-footer-text {
    margin: 0;
}

/* Override GeneratePress header */
#masthead,
.site-header,
#site-navigation,
.site-footer,
#colophon {
    display: none !important;
}

.egypt-pattern {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.egypt-pattern > main,
.egypt-pattern > .entry-content,
.egypt-pattern > .site-main {
    flex: 1;
}

/* --- Hero Section --- */
.egypt-hero {
    color: var(--text-light);
    padding: 60px 24px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.egypt-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/wp-content/uploads/2026/07/pexels-edmond-dantes-8068011-1536x1024.jpg');
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    filter: brightness(0.4) saturate(0.9);
    transform: scale(1.05);
    z-index: 0;
}

.egypt-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, 
        rgba(10, 22, 40, 0.5) 0%, 
        rgba(30, 58, 95, 0.25) 50%, 
        rgba(10, 22, 40, 0.4) 100%
    );
    z-index: 0;
    pointer-events: none;
}

.egypt-hero-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.egypt-hero-title {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -1px;
    font-family: var(--font-en);
}

.egypt-hero-title span {
    color: var(--gold);
}

.egypt-hero-subtitle {
    font-size: 18px;
    opacity: 0.85;
    margin-bottom: 32px;
    line-height: 1.7;
    font-family: var(--font-en);
}

[dir="rtl"] .egypt-hero-title {
    font-family: var(--font-ar);
    font-weight: 700;
}

[dir="rtl"] .egypt-hero-subtitle {
    font-family: var(--font-ar);
}

/* --- Filters --- */
.egypt-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: -20px;
    position: relative;
    z-index: 2;
    padding: 0 24px;
}

.egypt-filter-btn {
    font-family: var(--font-en);
    padding: 10px 24px;
    border: 2px solid var(--gold);
    background: var(--lapis);
    color: var(--text-light);
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    opacity: 0.85;
}

.egypt-filter-btn:hover {
    opacity: 1;
    background: var(--lapis-light);
    border-color: var(--gold-light);
    transform: translateY(-1px);
}

.egypt-filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--lapis-dark);
    font-weight: 700;
    opacity: 1;
}

[dir="rtl"] .egypt-filter-btn {
    font-family: var(--font-ar);
}

/* --- Main Content --- */
.egypt-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

[dir="rtl"] .egypt-main {
    direction: rtl;
}

.egypt-section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--lapis-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-en);
}

[dir="rtl"] .egypt-section-title {
    font-family: var(--font-ar);
    font-weight: 700;
}

.egypt-section-title .count {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--sand);
    padding: 2px 12px;
    border-radius: 50px;
}

/* --- Jobs Grid --- */
.egypt-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* --- Job Card --- */
.egypt-job-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.egypt-job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--lapis));
    opacity: 0;
    transition: var(--transition);
}

.egypt-job-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-hover);
    border-color: var(--gold);
}

.egypt-job-card:hover::before {
    opacity: 1;
}

.egypt-job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.egypt-job-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lapis);
    background: var(--sand);
    padding: 4px 12px;
    border-radius: 50px;
}

.egypt-job-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-dark);
    white-space: nowrap;
}

[dir="rtl"] .egypt-job-price {
    direction: ltr;
    unicode-bidi: embed;
}

.egypt-job-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--lapis-dark);
    line-height: 1.4;
}

.egypt-job-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.egypt-job-question {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--sand-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
    font-size: 13px;
    color: var(--text-secondary);
}

[dir="rtl"] .egypt-job-question {
    border-left: none;
    border-right: 3px solid var(--gold);
}

.egypt-job-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.egypt-job-meta-item {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.egypt-job-apply-btn {
    font-family: var(--font-en);
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: var(--lapis);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.egypt-job-apply-btn:hover {
    background: var(--lapis-light);
    transform: translateY(-1px);
}

[dir="rtl"] .egypt-job-apply-btn {
    font-family: var(--font-ar);
}

/* --- Empty State --- */
.egypt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 16px var(--shadow);
    border: 1px solid var(--border);
}

.egypt-empty-icon {
    font-size: 64px;
    color: var(--gold);
    margin-bottom: 24px;
    opacity: 0.6;
}

.egypt-empty-title {
    font-family: var(--font-primary, var(--font-en));
    font-size: 24px;
    font-weight: 600;
    color: var(--lapis-dark);
    margin-bottom: 12px;
}

.egypt-empty-subtitle {
    font-family: var(--font-primary, var(--font-en));
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

[dir="rtl"] .egypt-empty-title,
[dir="rtl"] .egypt-empty-subtitle {
    font-family: var(--font-ar);
}

[dir="rtl"] .egypt-empty-title {
    font-weight: 700;
}

/* --- Chat Page Styles --- */
.chat-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.chat-header-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-job-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--lapis-dark);
}

.chat-job-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-dark);
}

.chat-back-btn {
    font-family: var(--font-en);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--sand);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
}

.chat-back-btn:hover {
    background: var(--sand-dark);
}

/* --- Chat Messages --- */
.chat-messages {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
    animation: msgIn 0.3s ease;
}

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

.message-system {
    background: var(--sand-light);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-user {
    background: var(--lapis);
    color: var(--text-light);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-support {
    background: var(--gold-light);
    color: var(--lapis-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-payment {
    background: var(--sand-light);
    border: 1px dashed var(--gold);
    align-self: center;
    text-align: center;
    max-width: 100% !important;
    padding: 20px;
}

.message-payment .payment-details {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.message-payment .payment-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-dark);
    margin: 8px 0;
}

/* --- Chat Input --- */
.chat-input-area {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-en);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    resize: none;
}

.chat-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}

.chat-send-btn {
    font-family: var(--font-en);
    padding: 12px 28px;
    background: var(--gold);
    color: var(--lapis-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: var(--gold-dark);
    transform: translateY(-1px);
}

/* --- Payment Confirm Button --- */
.payment-confirm-btn {
    font-family: var(--font-en);
    padding: 12px 32px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
}

.payment-confirm-btn:hover {
    background: #1B5E20;
    transform: translateY(-1px);
}

/* --- Rejection Banner --- */
.rejection-banner {
    background: linear-gradient(135deg, var(--terracotta), #D4764A);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
}

/* RTL chat fixes */
[dir="rtl"] .message-user {
    border-bottom-right-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
}

[dir="rtl"] .message-system,
[dir="rtl"] .message-support {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: 4px;
}

[dir="rtl"] .chat-input {
    font-family: var(--font-ar);
}

/* --- Responsive Chat --- */
@media (max-width: 768px) {
    .chat-page {
        padding: 16px;
    }

    .message {
        max-width: 90%;
    }

    .chat-header-card {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .chat-input-area {
        flex-direction: column;
    }

    .chat-send-btn {
        width: 100%;
    }

    .egypt-logo-icon {
        font-size: 28px;
    }

    .egypt-logo-text {
        font-size: 18px;
    }

    .egypt-logo-subtitle {
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    .egypt-lang-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    .egypt-header-inner {
        padding: 10px 16px;
    }
}

@media (max-width: 375px) {
    .egypt-logo-icon {
        font-size: 24px !important;
    }

    .egypt-logo-text {
        font-size: 16px !important;
    }

    .egypt-logo-subtitle {
        font-size: 8px !important;
        letter-spacing: 1px !important;
    }

    .egypt-lang-btn {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }

    .egypt-header-inner {
        padding: 8px 12px !important;
    }

    [dir="rtl"] .egypt-header-inner {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* --- Empty Page --- */
.egypt-empty-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 24px;
}

.egypt-page-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.egypt-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 2px 16px var(--shadow);
    border: 1px solid var(--border);
}

.egypt-entry-content {
    font-family: var(--font-primary, var(--font-en));
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 16px;
}

.egypt-entry-content h1,
.egypt-entry-content h2,
.egypt-entry-content h3 {
    color: var(--lapis-dark);
    margin-bottom: 16px;
    font-weight: 600;
}

.egypt-entry-content h1 { font-size: 28px; }
.egypt-entry-content h2 { font-size: 22px; }
.egypt-entry-content h3 { font-size: 18px; }

.egypt-entry-content p {
    margin-bottom: 16px;
}

.egypt-entry-content a {
    color: var(--lapis);
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
    transition: var(--transition);
}

.egypt-entry-content a:hover {
    color: var(--gold-dark);
    border-bottom-color: var(--gold-dark);
}

/* RTL support for empty page */
[dir="rtl"] .egypt-entry-content {
    font-family: var(--font-ar);
}

[dir="rtl"] .egypt-entry-content h1,
[dir="rtl"] .egypt-entry-content h2,
[dir="rtl"] .egypt-entry-content h3 {
    font-family: var(--font-ar);
    font-weight: 700;
}

/* --- Empty State (no content) --- */
.egypt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 16px var(--shadow);
    border: 1px solid var(--border);
}

.egypt-empty-icon {
    font-size: 64px;
    color: var(--gold);
    margin-bottom: 24px;
    opacity: 0.6;
}

.egypt-empty-title {
    font-family: var(--font-primary, var(--font-en));
    font-size: 24px;
    font-weight: 600;
    color: var(--lapis-dark);
    margin-bottom: 12px;
}

.egypt-empty-subtitle {
    font-family: var(--font-primary, var(--font-en));
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

[dir="rtl"] .egypt-empty-title,
[dir="rtl"] .egypt-empty-subtitle {
    font-family: var(--font-ar);
}

[dir="rtl"] .egypt-empty-title {
    font-weight: 700;
}
