/* styles.css */
:root {
    /* Color Palette */
    --bg-color: #050505;
    --bg-alt: #0a0a0a;
    --surface-color: #111111;
    --surface-hover: #181818;
    
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-color: #27272a;
    --border-hover: #3f3f46;
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', ui-serif, Georgia, serif;
    
    /* Spacing */
    --section-padding: 8rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    /* Custom Colors */
    --gold-dark: #B8860B;
}

.text-gold-dark {
    color: var(--gold-dark) !important;
    font-weight: 700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Arabic Font Override */
body.lang-ar {
    font-family: 'Sakkal Majalla', 'Noto Sans Arabic', Arial, sans-serif !important;
    font-size: 1.2rem !important; /* Increased base size for Arabic */
    line-height: 1.7 !important;
}

body.lang-ar h1, 
body.lang-ar h2, 
body.lang-ar h3, 
body.lang-ar h4, 
body.lang-ar h5, 
body.lang-ar h6,
body.lang-ar p,
body.lang-ar a,
body.lang-ar span,
body.lang-ar li,
body.lang-ar button,
body.lang-ar input,
body.lang-ar textarea {
    font-family: 'Sakkal Majalla', 'Noto Sans Arabic', Arial, sans-serif !important;
}

body.lang-ar h1 { font-size: 3.5rem !important; }
body.lang-ar h2 { font-size: 2.2rem !important; }
body.lang-ar h3 { font-size: 1.6rem !important; }
body.lang-ar p, body.lang-ar li { font-size: 1.3rem !important; }

/* Typography Basics */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-secondary);
}

/* Masterclass Featured Section */
.masterclass-featured {
    grid-column: 1 / -1;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 4px;
    margin-top: 2rem;
}

.mc-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.mc-video {
    position: relative;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.5);
}

.mc-video video {
    width: 100%;
    display: block;
    border: 1px solid rgba(197, 168, 124, 0.2);
}

.video-overlay-text {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--text-gold);
    color: var(--bg-color);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.mc-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-gold);
}

.mc-script-preview {
    font-family: 'Inter', 'Noto Sans Arabic', sans-serif;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.mc-script-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(transparent, var(--bg-alt));
}

@media (max-width: 900px) {
    .mc-container {
        grid-template-columns: 1fr;
    }
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.bg-alt {
    background-color: var(--bg-alt);
}

section {
    padding: var(--section-padding) 0;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    padding: 1rem 0;
    background-color: rgba(5, 5, 5, 0.8);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.journal-nav-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold) !important;
    border: 1px solid var(--gold);
    padding: 0.4rem 1.2rem !important;
    border-radius: 30px;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.journal-nav-btn:hover {
    background: var(--gold);
    color: var(--bg-dark) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--text-secondary);
    background: var(--surface-color);
}

/* RTL Support */
body.lang-ar {
    direction: rtl;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

body.lang-ar h1, 
body.lang-ar h2, 
body.lang-ar h3,
body.lang-ar .logo {
    font-family: 'Cairo', sans-serif;
}

body.lang-ar .hero-card li,
body.lang-ar .key-insights li {
    padding-left: 0;
    padding-right: 1.5rem;
}

body.lang-ar .hero-card li::before,
body.lang-ar .key-insights li::before {
    left: auto;
    right: 0;
}

body.lang-ar .positioning-quote {
    border-left: none;
    border-right: 2px solid var(--border-color);
    padding-left: 0;
    padding-right: 2rem;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background-color: var(--text-primary);
    color: var(--bg-color);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    background-color: var(--text-secondary);
    color: var(--bg-color);
}

/* Hero Section */
.hero {
    padding-top: 12rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-headline {
    max-width: 900px;
    margin-bottom: 1.5rem;
}

.hero-subheadline {
    font-size: 1.25rem;
    color: var(--text-primary);
    max-width: 700px;
    margin-bottom: 3rem;
}

.hero-meta {
    max-width: 600px;
    margin-bottom: 4rem;
}

.positioning-quote {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-style: italic;
    color: var(--text-primary);
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
    margin: 4rem 0;
    line-height: 1.4;
    max-width: 800px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
}

.hero-card ul {
    list-style: none;
}

.hero-card li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.hero-card li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--border-hover);
}

.featured-insights-preview {
    margin-bottom: 4rem;
}

.insights-preview-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.insight-item {
    padding: 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast);
}

.insight-item:hover {
    border-color: var(--border-hover);
}

.insight-item h4 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.insight-item p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.cta-banner {
    background: var(--surface-color);
    padding: 3rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.cta-banner p {
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: flex-start;
}

.about-image {
    position: relative;
    border: 1px solid var(--border-color);
    padding: 1rem;
    background: var(--surface-color);
    transition: border-color var(--transition-fast);
}

.about-image:hover {
    border-color: var(--border-hover);
}

/* Hero Profile Image */
.hero-profile-container {
    width: 280px;
    margin: 3rem auto;
    position: relative;
    border: 1px solid var(--border-color);
    padding: 10px;
    background: var(--surface-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.hero-profile-container:hover {
    transform: translateY(-5px);
    border-color: var(--text-secondary);
}

.hero-profile-img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.6s ease;
}

.hero-profile-container:hover .hero-profile-img {
    filter: grayscale(0%);
}

.hero-img-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    background: linear-gradient(to top right, rgba(0,0,0,0.1), transparent);
}

/* About Section Full Width */
.about-content.full-width {
    display: block;
    max-width: 850px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    text-align: justify;
}

.profile-img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(30%);
    transition: filter var(--transition-fast);
}

.about-image:hover .profile-img {
    filter: grayscale(0%);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to top right, rgba(0,0,0,0.2), transparent);
}

/* Insights Section */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.insight-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 3rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.insight-card:hover {
    border-color: var(--text-secondary);
    transform: translateY(-5px);
}

.tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.insight-card h3 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.insight-card .opening {
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.key-insights {
    list-style: none;
    margin-bottom: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.key-insights li {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

.key-insights li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

.insight-card .conclusion {
    font-style: italic;
    margin-bottom: 2rem;
}

.insight-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
    opacity: 0;
    margin-top: 0;
}

.insight-expanded.active {
    max-height: 500px;
    opacity: 1;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
}

.insight-expanded h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.insight-expanded p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 0;
    margin-top: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.btn-text:hover {
    color: var(--text-secondary);
    border-bottom-color: var(--text-secondary);
}

/* Publications & Media Grid */
.books-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.book-row {
    display: flex;
    flex-direction: row;
    gap: 4rem;
    align-items: flex-start;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
}

.book-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.book-video-section {
    flex: 1;
    min-width: 0;
}

body.lang-ar .book-video-section {
    order: 2; /* In RTL, pushing it to order 2 puts it on the left */
}

.book-row .book-card {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
    height: 100%;
}

@media (max-width: 900px) {
    .book-row {
        flex-direction: column;
    }
    body.lang-ar .book-video-section {
        order: initial;
    }
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.book-card {
    padding: 2rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    background: var(--bg-color);
}

.book-video-intro {
    max-width: 450px;
    margin: 1.5rem 0;
}

.book-trailer {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.video-intro-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.book-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
}

.book-card.placeholder {
    opacity: 0.6;
    border-style: dashed;
}

.media-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.video-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: all var(--transition-fast);
}

.play-btn-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.video-card:hover .video-thumbnail img {
    filter: brightness(1);
    transform: scale(1.05);
}

.video-card:hover .play-btn-overlay {
    opacity: 1;
    transform: scale(1.1);
}

.video-info {
    padding: 1.5rem;
}

.video-info h5 {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-primary);
    font-weight: 500;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.badge {
    padding: 0.5rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Contact Section */
.contact-section {
    max-width: 600px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.contact-content p {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.social-links a {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* Animations */
.section-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
    .hero-grid,
    .insights-preview-list,
    .insights-grid,
    .grid-2-col,
    .about-content,
    .media-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}
