/* 
 * AL-AMMAR Portfolio Premium Stylesheet
 * Brand Color Palette:
 * - Obsidian Jet Black: #0B0B0C to #111112
 * - Metallic Gold Gradient: #DFBA73 to #C5A059
 * - White Headers: #FFFFFF
 * - Muted Champagne: #E5D9C4
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

/* --- CSS Variables & Design Tokens --- */
:root {
    --bg-obsidian: #0b0b0c;
    --bg-obsidian-light: #111112;
    --bg-gradient: radial-gradient(circle at center, var(--bg-obsidian-light) 0%, var(--bg-obsidian) 100%);
    
    --gold-primary: #dfba73;
    --gold-secondary: #c5a059;
    --gold-gradient: linear-gradient(135deg, #dfba73 0%, #c5a059 50%, #dfba73 100%);
    --gold-gradient-hover: linear-gradient(135deg, #ffffff 0%, #dfba73 50%, #c5a059 100%);
    --gold-glow: 0 0 20px rgba(223, 186, 115, 0.35);
    --gold-glow-soft: 0 10px 30px rgba(223, 186, 115, 0.1);
    
    --text-white: #ffffff;
    --text-champagne: #e5d9c4;
    --text-muted: rgba(229, 217, 196, 0.6);
    
    --font-en-heading: 'Cinzel', serif;
    --font-en-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    --glass-bg: rgba(17, 17, 18, 0.45);
    --glass-border: 1px solid rgba(223, 186, 115, 0.15);
    --glass-blur: blur(12px);
    
    --nav-height: 80px;
}

/* --- Luxury Cream Light Theme Overrides --- */
body.light-theme {
    --bg-obsidian: #f5f4ef; /* Luxury warm cream/off-white */
    --bg-obsidian-light: #ffffff; /* White surfaces/cards */
    --bg-gradient: radial-gradient(circle at center, var(--bg-obsidian-light) 0%, var(--bg-obsidian) 100%);
    
    --gold-primary: #c5a059; /* Contrast gold */
    --gold-secondary: #dfba73;
    --gold-gradient: linear-gradient(135deg, #c5a059 0%, #dfba73 50%, #c5a059 100%);
    --gold-gradient-hover: linear-gradient(135deg, #1c1a17 0%, #c5a059 50%, #dfba73 100%);
    --gold-glow: 0 0 20px rgba(197, 160, 89, 0.2);
    --gold-glow-soft: 0 10px 30px rgba(197, 160, 89, 0.05);
    
    --text-white: #1c1a17; /* Dark charcoal/brown headings */
    --text-champagne: #4a453f; /* soft body text */
    --text-muted: rgba(74, 69, 63, 0.65);
    
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(197, 160, 89, 0.22);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-obsidian);
    overflow-x: hidden;
}

body {
    background: var(--bg-gradient);
    color: var(--text-champagne);
    font-family: var(--font-en-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-obsidian);
}
::-webkit-scrollbar-thumb {
    background: var(--gold-gradient);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-white);
}

/* Base Typography links & buttons */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-en-heading);
    color: var(--text-white);
    letter-spacing: 1px;
}

/* --- Dynamic Bilingual Typesetting (Urdu Adjustments) --- */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6 {
    font-family: 'Noto Nastaliq Urdu', var(--font-en-heading), serif;
    line-height: 1.8;
}

body.rtl p, body.rtl a, body.rtl span, body.rtl li, body.rtl label, body.rtl button, body.rtl input, body.rtl textarea {
    font-family: 'Noto Nastaliq Urdu', var(--font-en-body), sans-serif;
    line-height: 2.4;
    font-size: 1.08rem;
}

body.rtl .hero-tagline {
    font-size: 1.5rem !important;
    word-spacing: 4px;
}

body.rtl .hero-title {
    font-size: 5.5rem !important;
    font-weight: 700;
    margin-bottom: 2rem !important;
}

body.rtl .logo-text {
    font-family: 'Noto Nastaliq Urdu', var(--font-en-heading), serif;
    font-size: 1.5rem;
    padding-top: 5px;
}

body.rtl .nav-links {
    margin-left: 0;
    margin-right: auto;
}

body.rtl .lang-btn i {
    margin-left: 0;
    margin-right: 8px;
}

/* --- Dynamic interactive Canvas Background --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* --- Premium Preloader Screen --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-obsidian);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-ring {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(223, 186, 115, 0.1);
}

.loader-ring::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--gold-primary);
    border-right-color: var(--gold-secondary);
    animation: rotate-loader 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(223, 186, 115, 0.5);
}

.loader-text {
    margin-top: 25px;
    font-family: var(--font-en-heading);
    color: var(--text-white);
    letter-spacing: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes rotate-loader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; text-shadow: 0 0 5px rgba(223, 186, 115, 0); }
    50% { opacity: 1; text-shadow: 0 0 10px rgba(223, 186, 115, 0.6); }
}

/* --- Sticky Navigation Bar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--glass-bg);
    border-bottom: 1px solid rgba(223, 186, 115, 0.12);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    height: 70px;
    background: rgba(11, 11, 12, 0.9);
    border-bottom-color: rgba(223, 186, 115, 0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand img {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(223, 186, 115, 0.3));
    transition: var(--transition-smooth);
}

.nav-brand:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.logo-text {
    font-family: var(--font-en-heading);
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 35px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding: 5px 0;
    color: var(--text-champagne);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold-gradient);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(223, 186, 115, 0.4);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Bilingual Language Toggle */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-btn {
    border: 1px solid rgba(223, 186, 115, 0.3);
    padding: 6px 16px;
    border-radius: 30px;
    background: rgba(223, 186, 115, 0.05);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-primary);
}

.lang-btn:hover {
    background: var(--gold-gradient);
    color: var(--bg-obsidian);
    border-color: transparent;
    box-shadow: var(--gold-glow);
}

/* Light/Dark Theme Switch Toggle */
.theme-toggle-btn {
    border: 1px solid rgba(223, 186, 115, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(223, 186, 115, 0.05);
    font-size: 0.9rem;
    color: var(--gold-primary);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle-btn:hover {
    background: var(--gold-gradient);
    color: var(--bg-obsidian);
    border-color: transparent;
    box-shadow: var(--gold-glow);
    transform: rotate(15deg);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 28px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--gold-primary);
    transition: var(--transition-smooth);
}

/* --- Hero Banner Section --- */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
    overflow: hidden;
    padding: 0 20px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, var(--bg-obsidian) 90%);
    pointer-events: none;
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    transform: translateY(0px); /* adjusted in parallax */
    will-change: transform;
}

.hero-logo {
    height: 120px;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 15px rgba(223, 186, 115, 0.25));
    animation: float-logo 6s ease-in-out infinite;
}

@keyframes float-logo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 0%, #dfba73 50%, #c5a059 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    letter-spacing: 6px;
    text-shadow: 0 0 40px rgba(223, 186, 115, 0.1);
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-champagne);
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 3rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Pulsing Chevron Down */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gold-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.scroll-indicator:hover {
    color: var(--text-white);
}

.scroll-indicator span {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}

.scroll-indicator i {
    font-size: 1.5rem;
    animation: pulse-bounce 2s infinite;
}

@keyframes pulse-bounce {
    0%, 100%, 20%, 50%, 80% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-4px); }
}

/* --- Section Formatting --- */
.section {
    position: relative;
    padding: 100px 8%;
    z-index: 2;
    overflow: hidden;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto;
}

.section-title {
    font-size: 2.6rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 15px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--gold-gradient);
    margin: 15px auto 0 auto;
}

.section-desc {
    color: var(--text-champagne);
    font-size: 1.05rem;
    opacity: 0.8;
}

/* --- About Pillars Section (Grid) --- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.pillar-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.pillar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(223, 186, 115, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.pillar-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(223, 186, 115, 0.05);
    border: 1px solid rgba(223, 186, 115, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 25px auto;
    transition: var(--transition-smooth);
    box-shadow: inset 0 0 10px rgba(223, 186, 115, 0.05);
}

.pillar-icon-wrapper i {
    font-size: 1.8rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition-smooth);
}

.pillar-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
}

.pillar-card p {
    font-size: 0.95rem;
    color: var(--text-champagne);
    opacity: 0.75;
    line-height: 1.7;
}

/* Pillar Hover States */
.pillar-card:hover {
    transform: translateY(-8px);
    border-color: rgba(223, 186, 115, 0.45);
    box-shadow: var(--gold-glow-soft);
}

.pillar-card:hover::before {
    opacity: 1;
}

.pillar-card:hover .pillar-icon-wrapper {
    background: var(--gold-gradient);
    border-color: transparent;
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--gold-glow);
}

.pillar-card:hover .pillar-icon-wrapper i {
    -webkit-text-fill-color: var(--bg-obsidian);
}

.pillar-card:hover h3 {
    color: var(--text-white);
    text-shadow: 0 0 5px rgba(223, 186, 115, 0.3);
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.service-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 50px 40px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--gold-gradient);
    transition: var(--transition-smooth);
}

.service-icon {
    font-size: 2.2rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    display: inline-block;
    transition: var(--transition-bounce);
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 600;
}

.service-card p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.8;
}

/* Service Hover States */
.service-card:hover {
    transform: translateY(-5px);
    border-color: rgba(223, 186, 115, 0.3);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.service-card:hover::after {
    width: 100%;
}

.service-card:hover .service-icon {
    transform: scale(1.15) translateY(-5px);
    filter: drop-shadow(0 0 10px rgba(223, 186, 115, 0.4));
}

/* --- Portfolio Grid Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.portfolio-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
}

.portfolio-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    border-bottom: 1px solid rgba(223, 186, 115, 0.1);
}

.portfolio-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 30%, rgba(11, 11, 12, 0.9) 100%);
    opacity: 0.85;
    transition: var(--transition-smooth);
}

.portfolio-info {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portfolio-info h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.portfolio-info p {
    font-size: 0.95rem;
    opacity: 0.75;
    margin-bottom: 25px;
    line-height: 1.7;
}

.portfolio-link {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--gold-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
}

.portfolio-link i {
    transition: var(--transition-smooth);
}

/* Portfolio Card Hover States */
.portfolio-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(223, 186, 115, 0.45);
    box-shadow: var(--gold-glow-soft);
}

.portfolio-card:hover .portfolio-img-wrapper img {
    transform: scale(1.08);
}

.portfolio-card:hover .portfolio-link {
    color: var(--text-white);
    text-shadow: 0 0 8px rgba(223, 186, 115, 0.5);
}

.portfolio-card:hover .portfolio-link i {
    transform: translateX(5px);
}

/* --- Contact & Footer Section --- */
.contact-container {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 50px;
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 50px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(223, 186, 115, 0.25);
    background: rgba(223, 186, 115, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold-primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.info-details h4 {
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
}

.info-details p {
    font-size: 0.95rem;
    opacity: 0.75;
}

.info-item:hover .info-icon {
    background: var(--gold-gradient);
    color: var(--bg-obsidian);
    box-shadow: var(--gold-glow);
    border-color: transparent;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input, 
.form-group textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(223, 186, 115, 0.15);
    padding: 15px;
    border-radius: 8px;
    color: var(--text-white);
    font-family: var(--font-en-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-group textarea {
    resize: none;
    height: 150px;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(223, 186, 115, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

.submit-btn {
    align-self: flex-start;
    padding: 14px 40px;
    border-radius: 30px;
    background: var(--gold-gradient);
    color: var(--bg-obsidian);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
    box-shadow: var(--gold-glow-soft);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--gold-glow);
    color: var(--bg-obsidian);
}

/* Footer Section */
.footer {
    position: relative;
    padding: 50px 8% 40px 8%;
    border-top: 1px solid rgba(223, 186, 115, 0.1);
    background: #070708;
    z-index: 2;
    text-align: center;
}

.footer-logo {
    height: 60px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 5px rgba(223, 186, 115, 0.2));
}

.footer p {
    font-size: 0.85rem;
    opacity: 0.6;
    letter-spacing: 1px;
}

/* --- Academy Courses Grid (3-Columns) --- */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.course-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
}

.course-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-bottom: 1px solid rgba(223, 186, 115, 0.1);
}

.course-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s ease;
}

.course-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-obsidian-light);
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

body.rtl .course-badge {
    right: auto;
    left: 15px;
}

.course-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-info h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.course-info p {
    font-size: 0.9rem;
    opacity: 0.75;
    margin-bottom: 20px;
    line-height: 1.6;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(223, 186, 115, 0.1);
    padding-top: 15px;
    margin-bottom: 20px;
}

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

.meta-item i {
    color: var(--gold-primary);
}

.meta-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.course-enroll-btn {
    display: block;
    text-align: center;
    background: rgba(223, 186, 115, 0.05);
    border: 1px solid rgba(223, 186, 115, 0.25);
    color: var(--gold-primary);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

.course-enroll-btn:hover {
    background: var(--gold-gradient);
    color: var(--bg-obsidian);
    border-color: transparent;
    box-shadow: var(--gold-glow);
}

.course-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(223, 186, 115, 0.45);
    box-shadow: var(--gold-glow-soft);
}

.course-card:hover .course-img-wrapper img {
    transform: scale(1.08);
}

/* --- Currency Switcher Custom Selector Styling --- */
.currency-btn {
    border: 1px solid rgba(223, 186, 115, 0.3);
    padding: 6px 16px;
    padding-right: 32px;
    border-radius: 30px;
    background: rgba(223, 186, 115, 0.05);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--gold-primary);
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23dfba73' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
}

body.light-theme .currency-btn {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23c5a059' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
}

.currency-btn:hover, .currency-btn:focus {
    background-color: var(--gold-primary);
    color: var(--bg-obsidian) !important;
    border-color: transparent;
    box-shadow: var(--gold-glow);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%230b0b0c' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
}

.currency-btn option {
    background: #111112;
    color: #dfba73;
}

body.light-theme .currency-btn option {
    background: #ffffff;
    color: #c5a059;
}

body.rtl .currency-btn {
    padding-right: 16px;
    padding-left: 32px;
    background-position: 12px center;
}

/* --- Reveal on Scroll Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }
.reveal-delay-4 { transition-delay: 0.6s; }

/* --- Responsive Layout Configurations (Media Queries) --- */
@media (max-width: 1200px) {
    .about-grid, .services-grid, .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .navbar {
        padding: 0 5%;
    }
    
    .navbar.scrolled {
        --nav-height: 70px;
    }
    
    .user-auth-nav.desktop-only {
        display: none !important;
    }
    
    .mobile-only-auth {
        display: block !important;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(11, 11, 12, 0.98);
        flex-direction: column;
        justify-content: center;
        gap: 30px;
        transition: var(--transition-smooth);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        border-bottom: 1px solid rgba(223, 186, 115, 0.15);
    }
    
    body.rtl .nav-links {
        left: auto;
        right: -100%;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    body.rtl .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        font-size: 1.2rem;
    }
    
    .navbar.scrolled {
        height: var(--nav-height);
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    body.rtl .hero-title {
        font-size: 3.8rem !important;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 35px;
    }
}

@media (max-width: 768px) {
    .about-grid, .services-grid, .portfolio-grid, .courses-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
        letter-spacing: 3px;
    }
    
    body.rtl .hero-title {
        font-size: clamp(2.2rem, 8vw, 3.2rem) !important;
    }
    
    .hero-tagline {
        font-size: 0.9rem;
        letter-spacing: 4px;
        margin-bottom: 2rem;
    }
    
    body.rtl .hero-tagline {
        font-size: 1.1rem !important;
    }
    
    .section {
        padding: 60px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .navbar {
        height: 70px;
        --nav-height: 70px;
        padding: 0 15px;
    }
    
    .nav-brand img {
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .menu-toggle {
        width: 26px;
        height: 18px;
    }
    
    .menu-toggle span {
        height: 2px;
    }
    
    .hero-logo {
        height: 90px;
        margin-bottom: 20px;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.4rem);
        letter-spacing: 2px;
    }
    
    body.rtl .hero-title {
        font-size: clamp(2rem, 7vw, 2.6rem) !important;
    }
    
    .hero-tagline {
        font-size: clamp(0.75rem, 2.5vw, 0.85rem);
        letter-spacing: 3px;
        margin-bottom: 1.5rem;
    }
    
    .section {
        padding: 50px 15px;
    }
    
    .section-title {
        font-size: clamp(1.6rem, 6vw, 2rem);
    }
    
    .section-desc {
        font-size: 0.9rem;
        margin-top: 10px;
    }
    
    /* Make sure cards and containers have less padding for tight viewports */
    .pillar-card, .service-card {
        padding: 20px 15px !important;
    }
    
    .contact-container {
        padding: 25px 15px !important;
        border-radius: 8px;
    }
    
    .info-item {
        gap: 15px;
    }
    
    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .submit-btn {
        width: 100%;
        text-align: center;
        padding: 12px 25px;
    }
}

@media (max-width: 350px) {
    .logo-text {
        display: none !important; /* Hide brand text on extremely small screens to prevent layout breaks */
    }
}



/* --- Course Card & Blog Card Mobile Responsiveness --- */
.card-actions-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.card-actions-row a {
    flex: 1;
}

@media (max-width: 500px) {
    .course-card .course-info {
        padding: 15px !important;
    }
    
    .course-card .course-info h3 {
        font-size: 1.1rem !important;
    }
    
    .course-card .course-info p {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }
    
    .course-card .course-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding-top: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .card-actions-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .card-actions-row a {
        width: 100% !important;
    }
}

/* CSS Container Queries: Dynamically stack content vertically when card itself is squeezed (< 410px) */
@container (max-width: 410px) {
    .course-card .course-info {
        padding: 15px !important;
    }
    
    .course-card .course-info h3 {
        font-size: 1.1rem !important;
    }
    
    .course-card .course-info p {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }
    
    .course-card .course-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding-top: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .card-actions-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .card-actions-row a {
        width: 100% !important;
    }
}


