@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: rgba(17, 24, 39, 0.7);
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(99, 102, 241, 0.4);
    
    --accent-indigo: #6366f1;
    --accent-indigo-glow: rgba(99, 102, 241, 0.15);
    --accent-teal: #14b8a6;
    --accent-teal-glow: rgba(20, 184, 166, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --badge-live-bg: rgba(16, 185, 129, 0.1);
    --badge-live-text: #10b981;
    --badge-review-bg: rgba(245, 158, 11, 0.1);
    --badge-review-text: #f59e0b;
    --badge-dev-bg: rgba(59, 130, 246, 0.1);
    --badge-dev-text: #3b82f6;

    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Inter', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body.lang-ar {
    font-family: var(--font-ar);
    direction: rtl;
}

body.lang-en {
    font-family: var(--font-en);
    direction: ltr;
}

/* Language Switcher Hide/Show Rules */
body.lang-ar .text-en {
    display: none !important;
}

body.lang-en .text-ar {
    display: none !important;
}

/* Background Gradients */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

.bg-glow-1 {
    top: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--accent-indigo) 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: 10%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-teal) 0%, transparent 70%);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
header {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.5rem;
}

.logo span {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo svg {
    width: 32px;
    height: 32px;
}

/* Language Toggle Button */
.lang-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 1.2rem;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.lang-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 15px var(--accent-indigo-glow);
}

/* Hero Section */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
    position: relative;
}

.profile-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    animation: morph 8s ease-in-out infinite alternate;
}

.profile-avatar svg {
    width: 55px;
    height: 55px;
    color: white;
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.lang-ar .hero h1 {
    font-size: 3rem;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.75;
}

.compliance-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.compliance-notice svg {
    color: var(--badge-live-text);
    width: 16px;
    height: 16px;
}

/* Apps Grid Section */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-teal));
    border-radius: 2px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

/* App Card */
.app-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.app-card:hover {
    transform: translateY(-8px);
    border-color: var(--card-hover-border);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.1), 0 0 1px 1px var(--card-hover-border) inset;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.app-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.app-icon-wrapper svg {
    width: 36px;
    height: 36px;
    color: var(--accent-indigo);
}

.app-card:nth-child(even) .app-icon-wrapper svg {
    color: var(--accent-teal);
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-live {
    background: var(--badge-live-bg);
    color: var(--badge-live-text);
}

.badge-review {
    background: var(--badge-review-bg);
    color: var(--badge-review-text);
}

.badge-dev {
    background: var(--badge-dev-bg);
    color: var(--badge-dev-text);
}

/* App Info */
.app-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.app-category {
    font-size: 0.8rem;
    color: var(--accent-teal);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.app-card:nth-child(even) .app-category {
    color: var(--accent-indigo);
}

.app-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    min-height: 76px;
}

/* App Links Buttons */
.app-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, var(--accent-indigo));
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
}

.btn-disabled {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--card-border);
    color: var(--text-muted);
    cursor: not-allowed;
    pointer-events: none;
}

/* Footer */
footer {
    background: rgba(7, 10, 17, 0.95);
    border-top: 1px solid var(--card-border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--accent-indigo);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-badge-group {
    display: flex;
    gap: 1rem;
}

.footer-badge {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-badge svg {
    width: 12px;
    height: 12px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.25rem;
    }
    body.lang-ar .hero h1 {
        font-size: 2.5rem;
    }
    .apps-grid {
        grid-template-columns: 1fr;
    }
    .nav-container {
        padding: 0 1rem;
    }
}
