/* Global UI helpers shared across custom Blade pages. */

/*
 * Native date pickers have limited styling support.
 * We render a custom light icon and keep native picker behavior.
 */
input[type="date"] {
    color-scheme: dark;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b8ceef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px 16px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 36px;
    height: 100%;
    cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: inherit;
}

input[type="date"]::-webkit-clear-button,
input[type="date"]::-webkit-inner-spin-button {
    display: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 245, 197, 0.55) rgba(8, 14, 24, 0.9);
}

body,
.table-wrap,
.modal-card,
.select-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 245, 197, 0.55) rgba(8, 14, 24, 0.9);
}

body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.select-menu::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track,
.select-menu::-webkit-scrollbar-track {
    background: rgba(8, 14, 24, 0.9);
    border: 1px solid rgba(118, 182, 255, 0.18);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.select-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(76, 245, 197, 0.78), rgba(86, 164, 255, 0.74));
    border: 2px solid rgba(8, 14, 24, 0.85);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.modal-card::-webkit-scrollbar-thumb:hover,
.select-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(112, 255, 220, 0.95), rgba(112, 184, 255, 0.9));
}

/* Shared premium hover treatment for sidebar links across pages. */
.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    overflow: hidden;
    transition: border-color 260ms ease, box-shadow 280ms ease, transform 260ms ease, background-color 260ms ease;
}

.side-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(76, 245, 197, 0.06), rgba(86, 164, 255, 0.32), rgba(76, 245, 197, 0.06));
    transform: translateX(-120%);
    transition: transform 420ms ease;
    pointer-events: none;
}

.side-link:hover {
    border-color: rgba(76, 245, 197, 0.72) !important;
    background: rgba(86, 164, 255, 0.16) !important;
    box-shadow: 0 0 0 1px rgba(76, 245, 197, 0.4), 0 8px 24px rgba(86, 164, 255, 0.3);
    transform: translateY(-1px);
}

.side-link:hover::after {
    transform: translateX(120%);
}

.side-link.is-disabled,
.side-link.is-disabled:hover {
    opacity: 0.5;
    border-color: rgba(123, 142, 176, 0.32) !important;
    background: rgba(101, 118, 151, 0.12) !important;
    color: rgba(208, 218, 236, 0.72) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
    pointer-events: none;
}

.side-link.is-disabled::after {
    display: none;
}

.side-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid rgba(76, 245, 197, 0.6);
    background: rgba(76, 245, 197, 0.22);
    color: #e9fff7;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    padding: 0 7px;
}

.side-link.side-link-super {
    border-color: rgba(255, 175, 92, 0.55) !important;
    background: rgba(255, 159, 67, 0.15) !important;
    color: #ffe6c8 !important;
}

.side-link.side-link-super:hover {
    border-color: rgba(255, 199, 136, 0.85) !important;
    background: rgba(255, 168, 78, 0.22) !important;
    box-shadow: 0 0 0 1px rgba(255, 192, 122, 0.48), 0 8px 24px rgba(255, 167, 70, 0.24) !important;
}

.side-link.side-link-super.active {
    border-color: rgba(255, 204, 145, 0.9) !important;
    background: rgba(255, 174, 82, 0.28) !important;
    color: #fff1dc !important;
}

body.sidebar-collapsed .side-link-badge {
    display: none;
}

@keyframes appCubeSpin {
    0% { transform: rotateX(-18deg) rotateY(0deg) rotateZ(2deg); }
    100% { transform: rotateX(-18deg) rotateY(360deg) rotateZ(2deg); }
}

@keyframes appCubeFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-9px) translateX(6px); }
}

.app-wire-deco {
    position: fixed;
    right: clamp(18px, 8vw, 120px);
    top: clamp(16px, 10vh, 120px);
    width: min(220px, 34vw);
    aspect-ratio: 1;
    perspective: 900px;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 1;
    animation: appCubeFloat 3000ms ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(86, 164, 255, 0.2));
    opacity: 0.9;
}

.app-wire-deco::before,
.app-wire-deco::after {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed rgba(76, 245, 197, 0.2);
    filter: blur(0.3px);
    pointer-events: none;
}

.app-wire-deco::after {
    inset: 26%;
    border-style: solid;
    border-color: rgba(86, 164, 255, 0.26);
}

.app-wire-cube {
    position: relative;
    width: 96px;
    height: 96px;
    transform-style: preserve-3d;
    animation: appCubeSpin 10s linear infinite;
}

.app-wire-cube .face {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(141, 220, 255, 0.56);
    background: linear-gradient(150deg, rgba(103, 188, 255, 0.08), rgba(76, 245, 197, 0.02));
    box-shadow: inset 0 0 20px rgba(103, 188, 255, 0.12);
}

.app-wire-cube .f1 { transform: translateZ(48px); }
.app-wire-cube .f2 { transform: rotateY(180deg) translateZ(48px); }
.app-wire-cube .f3 { transform: rotateY(90deg) translateZ(48px); }
.app-wire-cube .f4 { transform: rotateY(-90deg) translateZ(48px); }
.app-wire-cube .f5 { transform: rotateX(90deg) translateZ(48px); }
.app-wire-cube .f6 { transform: rotateX(-90deg) translateZ(48px); }

.app-wire-tag {
    position: absolute;
    color: rgba(158, 205, 242, 0.75);
    font-size: 12px;
    letter-spacing: 0.08em;
    font-family: "Rajdhani", "Outfit", sans-serif;
    text-transform: uppercase;
}

.app-wire-tag.s1 { top: 4%; left: 45%; }
.app-wire-tag.s2 { top: 34%; right: 5%; }
.app-wire-tag.s3 { bottom: 15%; right: 7%; }
.app-wire-tag.s4 { bottom: 7%; left: 8%; }
.app-wire-tag.s5 { top: 33%; left: 8%; }

@media (max-width: 920px) {
    .app-wire-deco {
        width: min(178px, 36vw);
        right: 4vw;
        top: 6vh;
        opacity: 0.72;
    }
}

@media (max-width: 640px) {
    .app-wire-deco {
        display: none;
    }
}

.app-auth-ribbon {
    position: sticky;
    top: 10px;
    z-index: 25;
    margin: 0 0 14px;
    border: 1px solid rgba(118, 182, 255, 0.25);
    background: rgba(8, 14, 24, 0.78);
    backdrop-filter: blur(5px);
    border-radius: 14px;
    padding: 12px 14px;
}

.app-auth-top-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.app-auth-mobile-toggle {
    display: none;
    border: 1px solid rgba(118, 182, 255, 0.35);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(86, 164, 255, 0.1);
    color: #d7e7ff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-auth-mobile-toggle-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 180ms ease;
    margin-top: -2px;
}

.app-auth-ribbon.is-mobile-collapsed .app-auth-mobile-toggle-icon {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.app-auth-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(118, 182, 255, 0.35);
    background: rgba(86, 164, 255, 0.12);
    color: #d7e7ff;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.app-auth-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-auth-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.app-auth-actions form {
    margin: 0;
}

.app-auth-actions a,
.app-auth-actions button {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(118, 182, 255, 0.35);
    border-radius: 999px;
    color: #d7e7ff;
    background: rgba(86, 164, 255, 0.1);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
    transition: border-color 260ms ease, box-shadow 280ms ease, transform 260ms ease, background-color 260ms ease;
}

.app-auth-actions a::before,
.app-auth-actions button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(76, 245, 197, 0.05), rgba(86, 164, 255, 0.3), rgba(76, 245, 197, 0.05));
    transform: translateX(-120%);
    transition: transform 420ms ease;
    pointer-events: none;
}

.app-auth-actions a:hover,
.app-auth-actions button:hover {
    border-color: rgba(76, 245, 197, 0.72);
    background: rgba(86, 164, 255, 0.16);
    box-shadow: 0 0 0 1px rgba(76, 245, 197, 0.4), 0 8px 24px rgba(86, 164, 255, 0.3);
    transform: translateY(-1px);
}

.app-auth-actions a:hover::before,
.app-auth-actions button:hover::before {
    transform: translateX(120%);
}

.app-auth-actions a:focus-visible,
.app-auth-actions button:focus-visible {
    outline: 2px solid rgba(76, 245, 197, 0.75);
    outline-offset: 2px;
}

.app-auth-settings-link {
    padding: 8px 12px !important;
}

.app-auth-settings-link span {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
}

.app-auth-note {
    margin: 10px 0 0;
    color: #d7e7ff;
    font-size: 14px;
    line-height: 1.45;
}

.app-auth-user-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 8px 0 12px;
    border: 1px solid rgba(76, 245, 197, 0.42);
    border-radius: 999px;
    padding: 4px 10px;
    color: #d9fff3;
    background: rgba(76, 245, 197, 0.12);
    font-family: "Rajdhani", "Outfit", sans-serif;
    letter-spacing: 0.03em;
}

.app-auth-user-label strong {
    color: #eefff9;
    font-weight: 700;
}

.app-bridge-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(118, 182, 255, 0.3);
    background: rgba(12, 24, 42, 0.7);
    color: #cde2ff;
    font-size: inherit;
    line-height: normal;
    width: fit-content;
    font-family: "Rajdhani", "Outfit", sans-serif;
    letter-spacing: 0.03em;
}

.app-bridge-status strong {
    font-family: inherit;
    letter-spacing: inherit;
    color: #e9f3ff;
}

.app-bridge-status.is-on {
    border-color: rgba(76, 245, 197, 0.5);
    background: rgba(76, 245, 197, 0.12);
    color: #defff5;
}

.app-bridge-status.is-off {
    border-color: rgba(255, 159, 159, 0.55);
    background: rgba(255, 120, 120, 0.12);
    color: #ffd3d3;
}

.app-usage-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.app-usage-pill {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
    border: 1px solid rgba(118, 182, 255, 0.3);
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(9, 18, 32, 0.72);
    color: #cde2ff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.app-usage-pill strong {
    color: #e9f3ff;
    font-family: "Rajdhani", "Outfit", sans-serif;
    letter-spacing: 0.02em;
}

.app-usage-reset {
    color: #9cb4d8;
    font-size: 11px;
    letter-spacing: 0.01em;
    line-height: 1;
}

.release-prompt {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 9, 18, 0.62);
    backdrop-filter: blur(3px);
}

.release-prompt[hidden] {
    display: none;
}

.release-prompt-card {
    width: min(560px, 96vw);
    border: 1px solid rgba(118, 182, 255, 0.36);
    border-radius: 16px;
    background: linear-gradient(150deg, rgba(8, 15, 28, 0.94), rgba(9, 28, 28, 0.78));
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.46);
    padding: 18px;
}

.release-prompt-kicker {
    margin: 0;
    font-family: "Rajdhani", "Outfit", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #92d7ff;
    font-size: 11px;
}

.release-prompt-card h2 {
    margin: 8px 0 6px;
    font-family: "Rajdhani", "Outfit", sans-serif;
    font-size: clamp(28px, 3.8vw, 38px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: #f1f7ff;
}

.release-prompt-card p {
    margin: 0;
    color: #c8dcff;
    line-height: 1.5;
}

.release-prompt-date {
    margin-top: 8px !important;
    font-family: "Rajdhani", "Outfit", sans-serif;
    color: #98b9e3 !important;
    letter-spacing: 0.04em;
    font-size: 12px;
}

.release-prompt-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.release-prompt-actions form {
    margin: 0;
}

.release-prompt-read,
.release-prompt-later {
    border: 1px solid rgba(118, 182, 255, 0.36);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    color: #d9edff;
    background: rgba(86, 164, 255, 0.12);
    cursor: pointer;
}

.release-prompt-read {
    border-color: rgba(76, 245, 197, 0.58);
    background: rgba(76, 245, 197, 0.2);
    color: #ebfff9;
}

.release-prompt-later {
    background: rgba(86, 164, 255, 0.08);
}

.release-prompt-read:hover,
.release-prompt-later:hover {
    border-color: rgba(76, 245, 197, 0.76);
}

@media (max-width: 560px) {
    .app-auth-ribbon {
        padding: 12px;
    }

    .app-auth-mobile-toggle {
        display: inline-flex;
    }

    .app-auth-ribbon.is-mobile-collapsed .app-auth-details {
        display: none;
    }

    .app-auth-avatar {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }
}
