/* Modern Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    --secondary-gradient: linear-gradient(135deg, #2dd4bf 0%, #3b82f6 100%);
    --accent: #a78bfa;
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ar);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Glow Effect */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.sphere-1 {
    width: 500px;
    height: 500px;
    background: #4f46e5;
    top: -100px;
    right: -100px;
}

.sphere-2 {
    width: 600px;
    height: 600px;
    background: #0d9488;
    bottom: -150px;
    left: -150px;
}

/* Typography Helpers */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header & Navbar */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-en);
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -1px;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #1e1b4b;
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(129, 140, 248, 0.5);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: #0f172a;
    box-shadow: 0 4px 20px rgba(45, 212, 191, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(45, 212, 191, 0.5);
}

.btn-outline {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
}

.hero-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: #a5b4fc;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Services Section */
.services {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.1);
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(167, 139, 250, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    background: var(--primary-gradient);
    color: #1e1b4b;
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

/* Status / Live Section */
.status-section {
    padding: 60px 0 100px 0;
}

.status-card {
    background: radial-gradient(circle at top right, rgba(45, 212, 191, 0.1), transparent), var(--card-bg);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 32px;
    padding: 3.5rem;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #2dd4bf;
    border-radius: 50%;
    box-shadow: 0 0 10px #2dd4bf;
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
}

.status-card h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.status-card p {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem auto;
    font-size: 1.1rem;
}

/* Contact Section */
.contact {
    padding: 100px 0;
}

.contact-box {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 4rem 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: rgba(45, 212, 191, 0.3);
    box-shadow: 0 10px 25px rgba(45, 212, 191, 0.1);
}

.contact-card i {
    font-size: 2.2rem;
    color: #2dd4bf;
    margin-bottom: 0.5rem;
}

.contact-card span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card strong {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* API Section */
.api-section {
    padding: 100px 0;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.api-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.api-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.api-image-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.2) 0%, transparent 70%);
    z-index: -1;
    filter: blur(20px);
}

.api-logo-img {
    width: 100%;
    max-width: 380px;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.api-logo-img:hover {
    transform: scale(1.03) translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(129, 140, 248, 0.3);
}

.api-content {
    flex: 1.2;
    text-align: right;
}

.api-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.api-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.api-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.api-feature-item {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.api-feature-item i {
    font-size: 1.5rem;
    padding-top: 0.2rem;
}

.text-teal { color: #2dd4bf; }
.text-purple { color: #c084fc; }
.text-blue { color: #60a5fa; }

.api-feature-item h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.api-feature-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.api-cta-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn-rapidapi {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(129, 140, 248, 0.4);
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.1);
}

.btn-rapidapi:hover {
    background: var(--primary-gradient);
    color: #0f172a;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.4);
}

.btn-zylalabs {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(45, 212, 191, 0.4);
    box-shadow: 0 4px 15px rgba(45, 212, 191, 0.1);
}

.btn-zylalabs:hover {
    background: var(--secondary-gradient);
    color: #0f172a;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .nav-links {
        display: none; /* simple hidden layout for mobile to keep clean style */
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .status-card, .contact-box {
        padding: 2rem 1.5rem;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .api-container {
        flex-direction: column;
        gap: 2.5rem;
    }
    
    .api-logo-img {
        max-width: 280px;
    }
    
    .api-cta-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .api-cta-buttons .btn {
        width: 100%;
    }
    
    .api-content {
        text-align: center;
    }
    
    .api-feature-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }
}

/* ==========================================
   Language Switcher & LTR Support
   ========================================== */

/* Toggle Visibility based on .en-mode */
body:not(.en-mode) .lang-en {
    display: none !important;
}
body.en-mode .lang-ar {
    display: none !important;
}

/* English Font Override */
body.en-mode {
    font-family: var(--font-en);
}

/* Layout adjustments in English (LTR) mode */
body.en-mode .api-content {
    text-align: left;
}

/* ==========================================
   API Interactive Demo Playground Styles
   ========================================== */

.api-playground {
    margin-top: 5rem;
    padding: 3rem;
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.playground-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.playground-header h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.playground-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

.playground-form {
    display: flex;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

body.en-mode .playground-form {
    flex-direction: row;
}

.playground-form input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.playground-form input:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
}

.playground-form button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

/* Spinner Loader */
.demo-loader {
    text-align: center;
    padding: 2rem 0;
}

.demo-loader p {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 0.95rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(45, 212, 191, 0.1);
    border-top-color: #2dd4bf;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s infinite linear;
}

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

/* Demo Results Rendering */
.demo-results {
    animation: fadeIn 0.5s ease-out;
}

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

.results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.res-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 150px;
}

.res-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.res-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px;
    overflow-y: auto;
}

.res-list li {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.res-list li::before {
    content: '•';
    color: var(--text-secondary);
}

.res-list li.empty-msg {
    color: #64748b;
    font-style: italic;
}

.res-list li.empty-msg::before {
    content: none;
}

/* JSON raw formatter */
.res-json-wrapper {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #64748b;
    font-size: 0.85rem;
    font-family: monospace;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.res-json-wrapper pre {
    margin: 0;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

.res-json-wrapper code {
    font-family: 'Courier New', Courier, monospace;
    color: #f1f5f9;
}

/* Error message styling */
.demo-error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fca5a5;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}

/* Mobile responsive fixes */
@media (max-width: 600px) {
    .playground-form {
        flex-direction: column !important;
    }
    
    .playground-form button {
        width: 100%;
    }
    
    .api-playground {
        padding: 1.5rem;
    }
}

