/**
 * Portal Pro — modern professional theme (vanilla CSS for CodeIgniter + Bootstrap).
 *
 * Tailwind-style equivalents (for reference or future Tailwind migration):
 * ---------------------------------------------------------------------------
 * Layout:
 *   Sidebar: fixed w-[250px], bg-white/75 backdrop-blur-md, border-r border-gray-200
 *   App shell: flex min-h-screen
 * Spaces grid:
 *   grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4
 * Cards:
 *   bg-white rounded-lg border border-[#E5E7EB] (rounded-lg = 8px in Tailwind v3)
 * Typography:
 *   font-sans: Inter; titles font-semibold; body text-sm leading-relaxed text-gray-600
 * Icon rings:
 *   size-11 rounded-full flex items-center justify-center (bg per accent token)
 * Primary button:
 *   rounded bg-gray-900 text-white hover:bg-gray-700 shadow-none
 */

.portal-pro-theme {
    --portal-pro-sidebar-w: 250px;
    --portal-pro-stroke: #e5e7eb;
    --portal-pro-stroke-hover: #d1d5db;
    --portal-pro-text: #111827;
    --portal-pro-muted: #6b7280;
    --portal-pro-surface: #ffffff;
    --portal-pro-sidebar-bg: rgba(255, 255, 255, 0.78);
    --portal-pro-page-bg: #f3f4f6;
    --portal-pro-primary-btn: #111827;
    --portal-pro-primary-btn-hover: #374151;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--portal-pro-text);
    -webkit-font-smoothing: antialiased;
}

.portal-pro-theme .portal-pro-app {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

@media (min-width: 992px) {
    .portal-pro-theme .portal-pro-app {
        flex-direction: row;
        align-items: stretch;
        min-height: calc(100vh - 0px);
    }
}

/* —— Sidebar (250px, glass) —— */
.portal-pro-theme .portal-pro-sidebar {
    width: 100%;
    flex-shrink: 0;
    background: var(--portal-pro-sidebar-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--portal-pro-stroke);
    border-radius: 8px;
    padding: 1rem 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 992px) {
    .portal-pro-theme .portal-pro-sidebar {
        width: var(--portal-pro-sidebar-w);
        margin-bottom: 0;
        margin-right: 1.5rem;
        border-radius: 8px;
        position: sticky;
        top: 1rem;
        align-self: flex-start;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

.portal-pro-theme .portal-pro-sidebar__brand {
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
    padding: 0.35rem 0.65rem 0.85rem;
    border-bottom: 1px solid var(--portal-pro-stroke);
    margin-bottom: 0.5rem;
}

.portal-pro-theme .portal-pro-sidebar__nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
}

@media (max-width: 991.98px) {
    .portal-pro-theme .portal-pro-sidebar__nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.2rem;
        scrollbar-width: thin;
    }
    .portal-pro-theme .portal-pro-sidebar__link {
        white-space: nowrap;
    }
}

@media (min-width: 992px) {
    .portal-pro-theme .portal-pro-sidebar__nav {
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
    }
}

.portal-pro-theme .portal-pro-sidebar__link {
    display: block;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--portal-pro-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.portal-pro-theme .portal-pro-sidebar__link:hover {
    background: rgba(17, 24, 39, 0.05);
    color: var(--portal-pro-text);
}

.portal-pro-theme .portal-pro-sidebar__link.is-active {
    background: rgba(17, 24, 39, 0.07);
    color: var(--portal-pro-text);
    border-color: rgba(17, 24, 39, 0.06);
}

/* —— Main column —— */
.portal-pro-theme .portal-pro-main {
    flex: 1;
    min-width: 0;
}

.portal-pro-theme .portal-pro-hero-title {
    font-weight: 600;
    font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.portal-pro-theme .portal-pro-hero-desc {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--portal-pro-muted);
    max-width: 42rem;
    margin: 0 0 1.5rem;
}

/* —— Spaces: 4-column grid —— */
.portal-pro-theme .portal-pro-spaces-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 576px) {
    .portal-pro-theme .portal-pro-spaces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portal-pro-theme .portal-pro-spaces-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .portal-pro-theme .portal-pro-spaces-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* —— Space cards —— */
.portal-pro-theme .portal-pro-space-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--portal-pro-surface);
    border-radius: 8px;
    border: 1px solid var(--portal-pro-stroke);
    padding: 1.15rem 1.2rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .portal-pro-theme .portal-pro-space-card:hover {
        border-color: var(--portal-pro-stroke-hover);
    }
}

.portal-pro-theme .portal-pro-space-card__row {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    min-width: 0;
}

.portal-pro-theme .portal-pro-space-card__body {
    flex: 1;
    min-width: 0;
}

.portal-pro-theme .portal-pro-space-card__title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
    margin: 0 0 0.35rem;
    color: var(--portal-pro-text);
}

.portal-pro-theme .portal-pro-space-card__desc {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--portal-pro-muted);
    margin: 0 0 0.65rem;
}

.portal-pro-theme .portal-pro-space-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.portal-pro-theme .portal-pro-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--portal-pro-text);
    background: #f9fafb;
    border: 1px solid var(--portal-pro-stroke);
    border-radius: 6px;
}

.portal-pro-theme .portal-pro-space-card__foot {
    margin-top: auto;
    padding-top: 0.85rem;
}

/* —— Circular icon accents —— */
.portal-pro-theme .portal-pro-icon-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
}

.portal-pro-theme .portal-pro-icon-ring--green {
    background: #d1fae5;
    color: #059669;
}

.portal-pro-theme .portal-pro-icon-ring--purple {
    background: #ede9fe;
    color: #7c3aed;
}

.portal-pro-theme .portal-pro-icon-ring--amber {
    background: #fef3c7;
    color: #d97706;
}

.portal-pro-theme .portal-pro-icon-ring--sky {
    background: #e0f2fe;
    color: #0284c7;
}

/* —— Buttons: high contrast, 4px radius, no shadow —— */
.portal-pro-theme .portal-pro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    min-height: 2.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 4px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.portal-pro-theme .portal-pro-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.portal-pro-theme .portal-pro-btn--primary {
    background: var(--portal-pro-primary-btn);
    border-color: var(--portal-pro-primary-btn);
    color: #fff;
    width: 100%;
}

.portal-pro-theme .portal-pro-btn--primary:hover {
    background: var(--portal-pro-primary-btn-hover);
    border-color: var(--portal-pro-primary-btn-hover);
    color: #fff;
}

.portal-pro-theme .portal-pro-btn--primary:active {
    background: #030712;
    border-color: #030712;
}
