/*
  Lightweight styling tweaks that complement the Tailwind-powered portal.
  Tailwind handles most layout/typography; here we set up reusable helpers.
*/

:root {
    color-scheme: dark;
}

.portal-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: color 150ms ease, background-color 150ms ease;
}

.portal-nav-link:hover {
    color: #38e07b;
}

.portal-nav-link.active {
    background: rgba(56, 224, 123, 0.16);
    color: #38e07b;
    box-shadow: inset 0 0 0 1px rgba(56, 224, 123, 0.22);
}

.portal-card {
    border-radius: 1rem;
    background: rgba(18, 32, 23, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 45px rgba(8, 20, 15, 0.45);
    backdrop-filter: blur(18px);
}

.portal-card--muted {
    background: rgba(12, 20, 16, 0.72);
}

.portal-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    background: rgba(56, 224, 123, 0.14);
    color: #38e07b;
}

.portal-status {
    display: inline-flex;
    align-items: center;
    gap: 0.325rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-status--draft {
    background: rgba(148, 163, 184, 0.16);
    color: rgba(226, 232, 240, 0.9);
}

.portal-status--pending {
    background: rgba(250, 204, 21, 0.18);
    color: rgba(250, 204, 21, 0.95);
}

.portal-status--changes {
    background: rgba(245, 158, 11, 0.2);
    color: rgba(253, 230, 138, 0.95);
}

.portal-status--approved,
.portal-status--published {
    background: rgba(56, 224, 123, 0.2);
    color: #38e07b;
}

.portal-status--rejected {
    background: rgba(248, 113, 113, 0.2);
    color: rgba(248, 113, 113, 0.95);
}

.portal-status--support-open,
.portal-status--support-in_progress {
    background: rgba(59, 130, 246, 0.18);
    color: rgba(191, 219, 254, 0.95);
}

.portal-status--support-resolved {
    background: rgba(56, 224, 123, 0.2);
    color: #38e07b;
}

.portal-status--support-closed {
    background: rgba(148, 163, 184, 0.16);
    color: rgba(226, 232, 240, 0.7);
}

.portal-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .portal-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-input,
.portal-textarea,
.portal-select {
    width: 100%;
    border-radius: 0.9rem !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(20, 32, 28, 0.65) !important;
    background-color: black !important;
    color: rgba(248, 250, 252, 0.95) !important;
    padding: 0.75rem 1rem;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
    box-shadow: none;
}

.portal-input::placeholder,
.portal-textarea::placeholder {
    color: rgba(226, 232, 240, 0.45);
}

.portal-input:focus,
.portal-textarea:focus,
.portal-select:focus {
    border-color: rgba(56, 224, 123, 0.8);
    box-shadow: 0 0 0 3px rgba(56, 224, 123, 0.22);
    background: rgba(20, 32, 28, 0.82);
    outline: none;
}

.portal-textarea {
    min-height: 7rem;
    resize: vertical;
}

.portal-select--multiple {
    min-height: 9.5rem;
}

.portal-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: #38e07b;
}

.portal-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.62);
    margin-bottom: 0.6rem;
}

.portal-help {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.55);
    margin-top: 0.45rem;
}

.portal-form-error {
    margin-top: 0.4rem;
    color: rgba(248, 113, 113, 0.95);
    font-size: 0.78rem;
    font-weight: 600;
}

[data-message-level~="success"] {
    background: rgba(56, 224, 123, 0.16);
    border-color: rgba(56, 224, 123, 0.35);
    color: #b8ffd7;
}

[data-message-level~="info"] {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.28);
    color: rgba(191, 219, 254, 0.95);
}

[data-message-level~="warning"] {
    background: rgba(250, 204, 21, 0.14);
    border-color: rgba(250, 204, 21, 0.3);
    color: rgba(250, 204, 21, 0.95);
}

/* Lightweight tooltips for inline help */
.portal-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(226, 232, 240, 0.85);
    background: rgba(255, 255, 255, 0.04);
    cursor: help;
    transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.portal-tip:hover {
    border-color: rgba(56, 224, 123, 0.6);
    color: #38e07b;
    background: rgba(56, 224, 123, 0.12);
}

.portal-tip::after {
    content: attr(data-tip);
    position: absolute;
    z-index: 40;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 0.6rem 0.8rem;
    max-width: 18rem;
    min-width: 12rem;
    font-size: 0.78rem;
    line-height: 1.2rem;
    white-space: normal;
    text-align: left;
    color: #e2e8f0;
    background: rgba(10, 18, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.6rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease;
}

.portal-tip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -2px);
}

.portal-suggest {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(12, 20, 16, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.portal-suggest__item {
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.portal-suggest__item:last-child {
    border-bottom: none;
}

.portal-suggest__item:hover {
    background: rgba(56, 224, 123, 0.12);
}

.portal-suggest__title {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.92rem;
}

.portal-suggest__meta {
    color: rgba(226, 232, 240, 0.65);
    font-size: 0.78rem;
}

[data-message-level~="warning"] {
    background: rgba(250, 204, 21, 0.16);
    border-color: rgba(250, 204, 21, 0.28);
    color: rgba(253, 224, 71, 0.95);
}

[data-message-level~="error"],
[data-message-level~="danger"] {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    color: rgba(254, 202, 202, 0.95);
}

.portal-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.portal-message__icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 0.1rem;
    text-transform: none;
}

.portal-message__title {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.8;
}

.portal-message__content {
    margin-top: 0.25rem;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(71, 85, 105, 0.28);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.75);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
}

/* Submit overlay */
#portal-submit-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.75rem;
    background:
        radial-gradient(circle at 16% 22%, rgba(64, 160, 120, 0.26), transparent 32%),
        radial-gradient(circle at 78% 18%, rgba(56, 224, 123, 0.18), transparent 34%),
        radial-gradient(circle at 68% 82%, rgba(34, 197, 200, 0.16), transparent 36%),
        rgba(8, 14, 12, 0.82);
    backdrop-filter: blur(16px) saturate(125%);
    -webkit-backdrop-filter: blur(16px) saturate(125%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease-out;
}

#portal-submit-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

.portal-submit-overlay__card {
    width: min(640px, 94vw);
    border-radius: 26px;
    background: linear-gradient(150deg, rgba(14, 24, 18, 0.95), rgba(10, 20, 16, 0.92));
    border: 1px solid rgba(56, 224, 123, 0.18);
    box-shadow:
        0 32px 120px rgba(0, 0, 0, 0.55),
        0 20px 50px rgba(56, 224, 123, 0.18),
        0 16px 44px rgba(34, 197, 200, 0.12);
    padding: 30px 32px;
    color: #fff;
}

.portal-submit-overlay__title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 0.45rem;
    letter-spacing: -0.015em;
}

.portal-submit-overlay__subtitle {
    margin: 0 0 1.8rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.55;
}

.portal-submit-overlay__progress {
    position: relative;
    height: 14px;
    width: 100%;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(10, 22, 19, 0.82), rgba(7, 16, 13, 0.88));
    box-shadow: inset 0 0 0 1px rgba(56, 224, 123, 0.18), 0 18px 30px rgba(0, 0, 0, 0.36);
}

.portal-submit-overlay__progress-bar {
    position: absolute;
    inset: 0;
    width: 50%;
    background: linear-gradient(90deg, #34d399, #22d3ee, #a855f7, #38e07b);
    filter: drop-shadow(0 0 16px rgba(56, 224, 123, 0.65));
    animation: portal-progress-sweep 2s ease-in-out infinite;
    border-radius: 999px;
}

@keyframes portal-progress-sweep {
    0% {
        transform: translateX(-130%);
    }
    50% {
        transform: translateX(8%);
    }
    100% {
        transform: translateX(130%);
    }
}

/* Select2 dark theme adjustments */
