/* =============================================================
   ELITE_DIGSPACE — Layout templates (1.0)
   Loaded LAST on every portal page (after the page stylesheet).
   Body classes come from eliteDsThemeBodyClass():
     .eds-portal-user | .eds-portal-admin | .eds-portal-auth
     .eds-tpl-classic | modern | minimal | corporate | elegant
   Colours and fonts are CSS variables set by includes/theme.php,
   so every template works with every colour and font family.
   ============================================================= */

/* ---------- Shared: things every template gets ---------- */
body[class*="eds-tpl-"] .header-org-avatar { background: rgba(255, 255, 255, .22); }
body[class*="eds-tpl-"] .form-control:focus,
body[class*="eds-tpl-"] .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15);
}
body[class*="eds-tpl-"] .progress-bar { background-color: var(--primary); }
body[class*="eds-tpl-"] ::selection { background: rgba(var(--primary-rgb), .18); }

/* =============================================================
   1. CLASSIC — the original look (nothing overridden)
   ============================================================= */
body.eds-tpl-classic .header-org-avatar { background: var(--teal); }

/* =============================================================
   2. MODERN — gradient header, light nav with underline, rounded
   ============================================================= */
body.eds-tpl-modern { background: var(--primary-50); }
body.eds-tpl-modern .site-header {
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 55%, var(--brand-deep) 130%);
    box-shadow: 0 6px 24px rgba(var(--primary-rgb), .22);
}
body.eds-tpl-modern .site-nav,
body.eds-tpl-modern .admin-nav {
    background: #ffffff;
    border-bottom: 1px solid var(--primary-100);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}
body.eds-tpl-modern .nav-link { color: #3b4458; position: relative; }
body.eds-tpl-modern .nav-link:hover,
body.eds-tpl-modern .nav-item.active .nav-link { color: var(--primary); background: transparent; }
body.eds-tpl-modern .nav-item.active > .nav-link::after {
    content: "";
    position: absolute;
    left: .9rem; right: .9rem; bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--primary);
}
body.eds-tpl-modern .nav-submenu { background: #ffffff; border: 1px solid var(--primary-100); border-radius: 12px; }
body.eds-tpl-modern .nav-submenu li a { color: #3b4458; }
body.eds-tpl-modern .nav-submenu li a:hover { color: var(--primary); background: var(--primary-50); }
body.eds-tpl-modern .nav-toggle,
body.eds-tpl-modern .notif-btn { color: #3b4458; }
body.eds-tpl-modern .notif-btn:hover { color: var(--primary); background: var(--primary-50); }
body.eds-tpl-modern .woc-card,
body.eds-tpl-modern .stat-card {
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
    border: 1px solid rgba(var(--primary-rgb), .06);
}
body.eds-tpl-modern .quick-btn,
body.eds-tpl-modern .btn-primary-custom { border-radius: 10px; }
body.eds-tpl-modern .woc-table th { background: var(--primary-50); color: var(--primary-dark); }
@media (max-width: 768px) {
    body.eds-tpl-modern .nav-menu { background: #ffffff; }
    body.eds-tpl-modern .nav-submenu { background: var(--primary-50); border: 0; }
    body.eds-tpl-modern .nav-item.active > .nav-link::after { display: none; }
}

/* =============================================================
   3. MINIMAL — white header & nav, flat bordered cards
   ============================================================= */
body.eds-tpl-minimal { background: #fafafa; }
body.eds-tpl-minimal .site-header {
    background: #ffffff;
    color: #111827;
    box-shadow: none;
    border-bottom: 1px solid #e5e7eb;
}
body.eds-tpl-minimal .header-title { color: var(--primary); }
body.eds-tpl-minimal .header-org-avatar { background: var(--primary); color: #fff; }
body.eds-tpl-minimal .header-org-name { color: #111827; }
body.eds-tpl-minimal .plan-badge {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-dark);
}
body.eds-tpl-minimal .admin-badge { background: var(--danger) !important; color: #fff; }
body.eds-tpl-minimal .site-nav,
body.eds-tpl-minimal .admin-nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}
body.eds-tpl-minimal .nav-link { color: #4b5563; text-transform: none; letter-spacing: 0; font-size: .86rem; }
body.eds-tpl-minimal .nav-link:hover { color: #111827; background: #f3f4f6; }
body.eds-tpl-minimal .nav-item.active .nav-link { color: var(--primary); background: transparent; font-weight: 700; }
body.eds-tpl-minimal .nav-submenu { background: #ffffff; border: 1px solid #e5e7eb; box-shadow: 0 8px 24px rgba(0, 0, 0, .06); }
body.eds-tpl-minimal .nav-submenu li a { color: #374151; }
body.eds-tpl-minimal .nav-submenu li a:hover { color: var(--primary); background: #f9fafb; }
body.eds-tpl-minimal .nav-toggle,
body.eds-tpl-minimal .notif-btn { color: #374151; }
body.eds-tpl-minimal .notif-btn:hover { color: var(--primary); background: #f3f4f6; }
body.eds-tpl-minimal .woc-card,
body.eds-tpl-minimal .stat-card {
    box-shadow: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
body.eds-tpl-minimal .woc-table th { background: transparent; border-bottom: 1px solid #e5e7eb; }
body.eds-tpl-minimal .quick-btn { box-shadow: none; }
@media (max-width: 768px) {
    body.eds-tpl-minimal .nav-menu { background: #ffffff; border-bottom: 1px solid #e5e7eb; }
    body.eds-tpl-minimal .nav-submenu { background: #f9fafb; }
}

/* =============================================================
   4. CORPORATE — deep header, coloured nav, square corners
   ============================================================= */
body.eds-tpl-corporate { background: #f2f4f7; --radius: 3px; }
body.eds-tpl-corporate .site-header { background: var(--brand-deep); box-shadow: none; }
body.eds-tpl-corporate .site-nav,
body.eds-tpl-corporate .admin-nav { background: var(--primary); }
body.eds-tpl-corporate .nav-link { color: rgba(255, 255, 255, .88); }
body.eds-tpl-corporate .nav-link:hover,
body.eds-tpl-corporate .nav-item.active .nav-link { color: #fff; background: rgba(0, 0, 0, .18); }
body.eds-tpl-corporate .nav-submenu { background: var(--primary-dark); border-radius: 0; }
body.eds-tpl-corporate .header-org-avatar { background: var(--primary); }
body.eds-tpl-corporate .woc-card,
body.eds-tpl-corporate .stat-card {
    border-radius: 3px;
    border-top: 3px solid var(--primary);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
body.eds-tpl-corporate .woc-card-title,
body.eds-tpl-corporate .welcome-title { text-transform: uppercase; letter-spacing: .04em; }
body.eds-tpl-corporate .woc-card-title { font-size: .92rem; }
body.eds-tpl-corporate .quick-btn,
body.eds-tpl-corporate .btn-primary-custom,
body.eds-tpl-corporate .form-control,
body.eds-tpl-corporate .form-select,
body.eds-tpl-corporate .status-chip { border-radius: 3px; }
body.eds-tpl-corporate .woc-table th { background: var(--brand-deep); color: #fff; border-bottom: 0; }
@media (max-width: 768px) {
    body.eds-tpl-corporate .nav-menu { background: var(--primary); }
    body.eds-tpl-corporate .nav-submenu { background: var(--primary-dark); }
}

/* =============================================================
   5. ELEGANT — tinted background, frosted cards, pill shapes
   ============================================================= */
body.eds-tpl-elegant {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(var(--primary-rgb), .12), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(var(--primary-rgb), .10), transparent 60%),
        var(--primary-50);
    background-attachment: fixed;
}
body.eds-tpl-elegant .site-header {
    background: rgba(255, 255, 255, .82);
    color: var(--brand-deep);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(var(--primary-rgb), .12);
}
body.eds-tpl-elegant .header-title { color: var(--primary); }
body.eds-tpl-elegant .header-org-avatar { background: var(--primary); color: #fff; }
body.eds-tpl-elegant .header-org-name { color: var(--brand-deep); }
body.eds-tpl-elegant .plan-badge { background: var(--primary-100); border-color: var(--primary-200); color: var(--primary-dark); }
body.eds-tpl-elegant .admin-badge { background: var(--danger) !important; color: #fff; }
body.eds-tpl-elegant .site-nav,
body.eds-tpl-elegant .admin-nav {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: .35rem 1rem;
    border-bottom: 1px solid rgba(var(--primary-rgb), .1);
}
body.eds-tpl-elegant .nav-link { color: #3b4458; border-radius: 999px; margin: 0 .1rem; }
body.eds-tpl-elegant .nav-link:hover { color: var(--primary); background: var(--primary-100); }
body.eds-tpl-elegant .nav-item.active .nav-link { color: #fff; background: var(--primary); }
body.eds-tpl-elegant .nav-submenu { background: #fff; border-radius: 14px; border: 1px solid var(--primary-100); }
body.eds-tpl-elegant .nav-submenu li a { color: #3b4458; }
body.eds-tpl-elegant .nav-submenu li a:hover { color: var(--primary); background: var(--primary-50); }
body.eds-tpl-elegant .nav-toggle,
body.eds-tpl-elegant .notif-btn { color: #3b4458; }
body.eds-tpl-elegant .notif-btn:hover { color: var(--primary); background: var(--primary-100); }
body.eds-tpl-elegant .woc-card,
body.eds-tpl-elegant .stat-card {
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 22px;
    box-shadow: 0 12px 40px rgba(var(--primary-rgb), .08);
}
body.eds-tpl-elegant .quick-btn,
body.eds-tpl-elegant .btn-primary-custom,
body.eds-tpl-elegant .status-chip { border-radius: 999px; }
body.eds-tpl-elegant .form-control,
body.eds-tpl-elegant .form-select { border-radius: 12px; }
body.eds-tpl-elegant .woc-table th { background: transparent; color: var(--primary-dark); }
@media (max-width: 768px) {
    body.eds-tpl-elegant .nav-menu { background: #fff; border-radius: 0 0 16px 16px; }
    body.eds-tpl-elegant .nav-submenu { background: var(--primary-50); }
}

/* Print: templates never affect printed documents. */
@media print {
    body[class*="eds-tpl-"] { background: #fff !important; }
}
