/**
 * BPR Workspace Theme — Enhanced CSS
 * Premium luxury bilingual UI — mobile-first, all screen sizes
 */

:root {
    --bg-primary: #080810;
    --bg-secondary: #0f0f1a;
    --bg-tertiary: #16162a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(26, 122, 76, 0.4);
    --green-primary: #1a7a4c;
    --green-light: #2ecc71;
    --green-dark: #0d4a2e;
    --gold: #c9a84c;
    --gold-light: #e6c76a;
    --gold-dark: #8b7432;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Inter', 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}
body[dir="rtl"] { font-family: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif; }
a { color: var(--green-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
p { color: var(--text-secondary); margin-bottom: 1rem; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
::selection { background: var(--green-primary); color: white; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 3px; }

/* SCROLL PROGRESS */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, var(--green-primary), var(--gold));
    z-index: 1001; transition: width 0.1s linear;
}

/* LOADING OVERLAY */
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--green-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* NAVBAR */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}
.navbar.scrolled {
    background: rgba(8, 8, 16, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem;
}
.navbar-brand {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
}
.navbar-brand .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--green-primary), var(--green-light));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 0.85rem; color: white;
    box-shadow: 0 0 20px rgba(26, 122, 76, 0.3);
}
.navbar-links {
    display: flex; align-items: center; gap: 0.25rem; list-style: none;
}
.navbar-links a {
    display: block; padding: 0.5rem 0.85rem;
    color: var(--text-secondary); font-size: 0.85rem;
    font-weight: 500; border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.navbar-links a:hover,
.navbar-links a.active { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }

/* MOBILE MENU */
.menu-toggle {
    display: none; background: none; border: none;
    color: var(--text-primary); cursor: pointer; padding: 0.5rem;
}
.menu-toggle svg { width: 24px; height: 24px; }

/* HERO */
.hero {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    padding: 6rem 0 4rem; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -50%; left: -20%; width: 60%; height: 120%;
    background: radial-gradient(ellipse, rgba(26, 122, 76, 0.08) 0%, transparent 70%);
}
.hero::after {
    content: ''; position: absolute; bottom: -30%; right: -10%; width: 50%; height: 100%;
    background: radial-gradient(ellipse, rgba(201, 168, 76, 0.05) 0%, transparent 70%);
}
.hero-content {
    position: relative; z-index: 1; text-align: center;
    max-width: 800px; margin: 0 auto;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 1rem; background: rgba(26, 122, 76, 0.1);
    border: 1px solid rgba(26, 122, 76, 0.2);
    border-radius: 100px; font-size: 0.78rem;
    font-weight: 600; color: var(--green-light); margin-bottom: 1.5rem;
}
.hero-badge .dot {
    width: 6px; height: 6px; background: var(--green-light);
    border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.5); } }
.hero h1 {
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold-light) 50%, var(--green-light) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary); margin-bottom: 2.5rem;
    max-width: 600px; margin-left: auto; margin-right: auto;
}
.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.hero-orb {
    position: absolute; border-radius: 50%; filter: blur(60px);
    pointer-events: none; animation: float 8s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(10px) rotate(-3deg); }
}

/* STATS BAR */
.stats-bar {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem; padding: 3rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}
.stat-item { text-align: center; padding: 1rem; }
.stat-number {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700; color: var(--green-light);
    line-height: 1; margin-bottom: 0.25rem;
}
.stat-label {
    font-size: 0.8rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
}

/* SECTIONS */
.section { padding: 5rem 0; position: relative; }
.section-header { text-align: center; max-width: 700px; margin: 0 auto 3.5rem; }
.section-label {
    display: inline-block; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--gold); margin-bottom: 0.75rem;
}

/* PLUGIN CARDS */
.plugins-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.plugin-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 1.5rem;
    transition: all var(--transition-med); position: relative; overflow: hidden;
    cursor: pointer;
}
.plugin-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--green-primary), var(--gold));
    opacity: 0; transition: opacity var(--transition-med);
}
.plugin-card:hover {
    background: var(--bg-card-hover); border-color: var(--border-glow);
    transform: translateY(-4px); box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.plugin-card:hover::before { opacity: 1; }
.plugin-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem;
}
.plugin-icon.nphies { background: linear-gradient(135deg, #1a7a4c, #2ecc71); color: white; }
.plugin-icon.copilot { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; }
.plugin-icon.browser { background: linear-gradient(135deg, #00b894, #55efc4); color: #0a0a0f; }
.plugin-icon.clinicflow { background: linear-gradient(135deg, #0984e3, #74b9ff); color: white; }
.plugin-icon.basma { background: linear-gradient(135deg, #e17055, #fab1a0); color: white; }
.plugin-icon.rosheta { background: linear-gradient(135deg, #fdcb6e, #ffeaa7); color: #0a0a0f; }
.plugin-icon.radiolinc { background: linear-gradient(135deg, #e84393, #fd79a8); color: white; }
.plugin-icon.lablinc { background: linear-gradient(135deg, #00cec9, #81ecec); color: #0a0a0f; }
.plugin-icon.nurses { background: linear-gradient(135deg, #636e72, #b2bec3); color: white; }
.plugin-icon.cpd { background: linear-gradient(135deg, var(--gold-dark), var(--gold-light)); color: #0a0a0f; }
.plugin-icon.courses { background: linear-gradient(135deg, #2d3436, #636e72); color: white; }
.plugin-icon.video { background: linear-gradient(135deg, #d63031, #ff7675); color: white; }
.plugin-name { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; }
.plugin-desc { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.5; }
.plugin-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 1rem; border-top: 1px solid var(--border-subtle);
}
.plugin-price { font-size: 0.9rem; font-weight: 700; color: var(--gold); }
.plugin-badge {
    font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 100px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.plugin-badge.licensed { background: rgba(46, 204, 113, 0.15); color: var(--green-light); }
.plugin-badge.available { background: rgba(201, 168, 76, 0.15); color: var(--gold); }

/* DASHBOARD */
.dashboard-page { padding-top: 6rem; min-height: 100vh; }
.dashboard-header {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 1rem;
    padding: 2rem 0; border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}
.dash-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.dash-stat {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 1.25rem; text-align: center;
}
.dash-stat-value { font-size: 1.75rem; font-weight: 700; color: var(--green-light); margin-bottom: 0.25rem; }
.dash-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.plugin-status-table {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); overflow: hidden;
}
.plugin-status-table table { width: 100%; border-collapse: collapse; }
.plugin-status-table th,
.plugin-status-table td {
    padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}
[dir="rtl"] .plugin-status-table th,
[dir="rtl"] .plugin-status-table td { text-align: right; }
.plugin-status-table th {
    background: rgba(255, 255, 255, 0.02); font-weight: 600; color: var(--text-muted);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.plugin-status-table tr:last-child td { border-bottom: none; }
.plugin-status-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* WATHQ CARDS */
.wathq-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.wathq-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 1.25rem;
    transition: all var(--transition-med);
}
.wathq-card:hover { border-color: var(--border-glow); background: var(--bg-card-hover); }
.wathq-card-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.wathq-card h4 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.wathq-card p { font-size: 0.8rem; margin: 0; }

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.55rem 1.25rem; font-weight: 600; font-size: 0.85rem;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast); text-decoration: none;
}
.btn-green {
    background: linear-gradient(135deg, var(--green-primary), var(--green-light));
    color: white; box-shadow: 0 0 30px rgba(26, 122, 76, 0.15);
}
.btn-green:hover { transform: translateY(-1px); box-shadow: 0 0 40px rgba(26, 122, 76, 0.3); color: white; }
.btn-gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
    color: #0a0a0f; box-shadow: 0 0 30px rgba(201, 168, 76, 0.12);
}
.btn-outline {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-outline:hover { border-color: var(--green-primary); color: var(--green-light); }

/* CONTACT FORM */
.contact-section { padding: 6rem 0; background: var(--bg-secondary); }
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 3rem; align-items: start;
}
.contact-info h3 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--text-primary); }
.contact-info p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.contact-item {
    display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem;
}
.contact-item-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: rgba(26, 122, 76, 0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.contact-item-text h4 { font-size: 0.9rem; margin-bottom: 0.15rem; color: var(--text-primary); }
.contact-item-text p { font-size: 0.85rem; margin: 0; color: var(--text-secondary); }
.contact-form {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 2rem;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 500;
    margin-bottom: 0.5rem; color: var(--text-secondary);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 0.9rem;
    transition: all var(--transition-fast);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none; border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(26, 122, 76, 0.15);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-submit {
    width: 100%; padding: 0.75rem;
    background: linear-gradient(135deg, var(--green-primary), var(--green-light));
    color: white; font-weight: 600; font-size: 0.9rem;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; transition: all var(--transition-fast);
}
.form-submit:hover { box-shadow: 0 0 30px rgba(26, 122, 76, 0.3); transform: translateY(-1px); }
.form-success {
    display: none; padding: 1rem;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: var(--radius-sm);
    color: var(--green-light); text-align: center; margin-top: 1rem;
}

/* FOOTER */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border-subtle);
    padding: 3rem 0 1.5rem;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem; margin-bottom: 2rem;
}
.footer h4 {
    font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1rem;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.5rem; }
.footer ul a { color: var(--text-secondary); font-size: 0.85rem; }
.footer ul a:hover { color: var(--green-light); }
.footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between;
    align-items: center; padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem; color: var(--text-muted);
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.6s ease-out forwards; opacity: 0; }
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* TABLET */
@media (max-width: 768px) {
    .navbar-links {
        position: fixed; top: 64px; left: 0; right: 0;
        background: rgba(8, 8, 16, 0.98); backdrop-filter: blur(20px);
        flex-direction: column; padding: 1rem;
        border-bottom: 1px solid var(--border-subtle);
        transform: translateY(-120%); transition: transform var(--transition-med);
    }
    .navbar-links.open { transform: translateY(0); }
    .menu-toggle { display: block; }
    .hero { min-height: 80vh; padding: 5rem 0 3rem; }
    .hero-orb { display: none; }
    .plugins-grid { grid-template-columns: 1fr; }
    .section { padding: 3rem 0; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .wathq-grid { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
    :root { font-size: 15px; }
    .container { padding: 0 1rem; }
    .navbar-inner { height: 56px; }
    .hero { min-height: 70vh; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; text-align: center; }
    .stats-bar { grid-template-columns: 1fr; }
    .wathq-grid { grid-template-columns: 1fr; }
    .dash-stats { grid-template-columns: 1fr 1fr; }
    .plugin-status-table { overflow-x: auto; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* ======================================== */
/*  TRUST RIBBONS                            */
/* ======================================== */

.bpr-trust-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.plugin-card .trust-ribbon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

[dir="rtl"] .plugin-card .trust-ribbon {
    right: auto;
    left: 0.75rem;
}
