/* ==========================================================================
   MaB DOCFLOWUAE — Enterprise SaaS Portal Styles (Light Mode Permanent)
   ========================================================================== */

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

:root {
    /* Color Palette - Light Theme (Locked Permanent) */
    --bg-main: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #FFFFFF;
    --glass-border: rgba(14, 33, 64, 0.1);
    --glass-shadow: 0 10px 30px rgba(14, 33, 64, 0.08);

    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;

    --brand-navy: #0E2140;
    --brand-blue: #2563EB;
    --brand-blue-hover: #1D4ED8;
    --brand-cyan: #0284C7;
    --brand-emerald: #10B981;
    --brand-gold: #D97706;
    --brand-red: #EF4444;

    --gradient-hero: linear-gradient(135deg, #0E2140 0%, #1E3A8A 100%);
    --gradient-card-glow: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 70%);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

html[dir="ltr"] body {
    direction: ltr;
    font-family: 'Inter', 'Cairo', system-ui, sans-serif;
}

/* Container */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 12px rgba(14, 33, 64, 0.04);
}

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

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.brand-logo-img {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--brand-navy);
    line-height: 1.2;
}

.brand-title span {
    color: var(--brand-blue);
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue) 0%, #1D4ED8 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
}

.btn-secondary {
    background: #F1F5F9;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: #E2E8F0;
    transform: translateY(-2px);
}

.btn-lang {
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-lang:hover {
    background: #F8FAFC;
    border-color: var(--brand-blue);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 60px 0 40px;
    background: var(--gradient-hero);
    color: #FFFFFF;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 860px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 16px;
}

.hero-title span {
    background: linear-gradient(135deg, #60A5FA 0%, #34D399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: #E2E8F0;
    font-weight: 500;
    margin-bottom: 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: #38BDF8;
}

.stat-label {
    font-size: 0.85rem;
    color: #94A3B8;
}

/* Controls Section (Tabs) */
.controls-section {
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.controls-card {
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 10px 25px rgba(14, 33, 64, 0.06);
}

/* Category Tabs */
.tabs-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: #F1F5F9;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--brand-blue);
    background: #E2E8F0;
}

.tab-btn.active {
    background: var(--brand-blue);
    color: #FFFFFF;
    border-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Applications Grid Section */
.apps-section {
    padding: 50px 0 80px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* STYLE B EXECUTIVE SHOWCASE HUB LAYOUT */
.apps-showcase-hub {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.showcase-stage {
    flex: 1.8;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(14, 33, 64, 0.06);
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.stage-icon {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-md);
    background: var(--brand-blue);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--brand-navy);
}

.stage-subtitle {
    font-size: 1rem;
    color: var(--brand-cyan);
    font-weight: 600;
}

.stage-badges {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge.live {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 0 0 currentColor;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tech-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #F1F5F9;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stage-heading {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 12px;
}

.stage-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.stage-features-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.stage-features-grid li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #F8FAFC;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.check-icon {
    color: var(--brand-emerald);
    font-weight: 900;
}

.stage-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.showcase-sidebar {
    flex: 1;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(14, 33, 64, 0.04);
}

.sidebar-prompt {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.sidebar-apps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-app-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #F8FAFC;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-app-item:hover {
    border-color: var(--brand-blue);
    background: #F1F5F9;
    transform: translateX(-4px);
}

html[dir="ltr"] .sidebar-app-item:hover {
    transform: translateX(4px);
}

.sidebar-app-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--brand-blue);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.app-item-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-app-item.active .app-item-icon {
    background: var(--brand-blue);
    color: #FFFFFF;
}

.app-item-info {
    flex: 1;
}

.app-item-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--brand-navy);
}

.app-item-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.empty-state svg {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(14, 33, 64, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 36px;
    box-shadow: 0 25px 50px rgba(14, 33, 64, 0.18);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #F1F5F9;
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

html[dir="ltr"] .modal-close-btn {
    left: auto;
    right: 20px;
}

.modal-close-btn:hover {
    background: var(--brand-blue);
    color: #FFFFFF;
}

.modal-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-app-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--brand-blue);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-app-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-navy);
}

.modal-app-subtitle {
    color: var(--brand-cyan);
    font-weight: 600;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 6px;
}

.link-box {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.domain-info {
    display: flex;
    flex-direction: column;
}

.domain-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.domain-url {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-blue);
    text-decoration: none;
}

/* Footer */
.footer {
    background: #FFFFFF;
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--brand-navy);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-title { font-size: 2.2rem; }
    .hero-stats { gap: 20px; }
    .apps-showcase-hub { flex-direction: column-reverse; }
}

@media (max-width: 768px) {
    .nav-container { height: 70px; }
    .brand-logo-img { height: 40px; }
    .brand-title { font-size: 1.2rem; }
    .hero-title { font-size: 1.8rem; }
    .hero-description { font-size: 1.0rem; }
    .apps-grid { grid-template-columns: 1fr; }
    .link-box { flex-direction: column; align-items: stretch; text-align: center; }
    .tabs-wrapper { justify-content: flex-start; }
    .stage-footer { flex-direction: column; text-align: center; }
}
