/* ================================================================
   PORTFÓLIO · PALETA DE COMANDOS
   ================================================================ */

/* ================================================================
   VARIÁVEIS GLOBAIS (:root)
   ================================================================ */

/* ================================================================
   BASE E RESET
   ================================================================ */

body.light .command-box {
    background: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.09), transparent 38%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.985), rgba(247, 248, 252, 0.985));
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 35px 90px rgba(15, 23, 42, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 0 65px rgba(99, 102, 241, 0.08);
    color: #16161b;
}

body.light .command-hint {
    background: rgba(0, 0, 0, 0.018);
    border-color: rgba(0, 0, 0, 0.07);
    color: #7a8192;
}

body.light .command-item {
    color: #555b6d;
}

body.light .command-item.active,
body.light .command-item:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.035), transparent);
    border-color: rgba(99, 102, 241, 0.12);
    color: #16161b;
}

body.light .command-item.selected {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.17), rgba(6, 182, 212, 0.055), rgba(255, 255, 255, 0.5)),
        rgba(99, 102, 241, 0.035);
    border-color: rgba(99, 102, 241, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 0 16px rgba(99, 102, 241, 0.06);
    color: #16161b;
}

body.light .command-item.selected:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.07), rgba(255, 255, 255, 0.55));
    border-color: rgba(99, 102, 241, 0.32);
}

body.light .command-palette {
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12), transparent 32%), rgba(239, 242, 248, 0.72);
}

body.light .command-search {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.025), transparent);
    border-color: rgba(0, 0, 0, 0.075);
}

body.light .command-search input {
    color: #16161b;
}

body.light .command-search input::placeholder {
    color: rgba(71, 78, 96, 0.52);
}

body.light .command-search kbd,
body.light .command-trigger kbd {
    background: rgba(0, 0, 0, 0.025);
    border-color: rgba(0, 0, 0, 0.1);
    color: #687084;
}

body.light .command-trigger {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 6px 20px rgba(15, 23, 42, 0.07);
}

/* ================================================================
   PALETA DE COMANDOS
   ================================================================ */

.command-box {
    background: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.17), transparent 38%),
        radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.065), transparent 32%),
        linear-gradient(145deg, rgba(20, 22, 34, 0.97), rgba(10, 11, 18, 0.985));
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.62),
        0 12px 35px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset,
        0 0 70px rgba(99, 102, 241, 0.08);
    color: #fff;
    overflow: hidden;
    position: relative;
    transform: translateY(-14px) scale(0.975);
    transform-origin: center center;
    transition: transform 0.28s cubic-bezier(0.2, 0.75, 0.25, 1),
        box-shadow 0.28s ease;
    width: min(650px, calc(100% - 28px));
}

.command-box::after {
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.command-box::before {
    background: linear-gradient(90deg,
            transparent,
            rgba(129, 140, 248, 0.8),
            rgba(34, 211, 238, 0.7),
            rgba(244, 114, 182, 0.45),
            transparent);
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.42);
    content: "";
    height: 1px;
    left: 7%;
    pointer-events: none;
    position: absolute;
    right: 7%;
    top: 0;
}

.command-hint {
    background: rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #858b9e;
    display: flex;
    font-size: 0.72rem;
    gap: 12px;
    justify-content: space-between;
    padding: 11px 14px;
    position: relative;
}

.command-hint kbd,
.command-search kbd,
.command-trigger kbd {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font: 600 0.65rem/1 inherit;
    opacity: 0.78;
    padding: 4px 6px;
}

.command-hint span {
    align-items: center;
    display: flex;
    gap: 5px;
}

.command-item {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #d8dbe5;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 12px;
    margin: 2px 0;
    padding: 12px 13px;
    position: relative;
    text-align: left;
    transition: color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
    width: 100%;
}

.command-item i {
    color: #67e8f9;
    filter: drop-shadow(0 0 7px rgba(34, 211, 238, 0.25));
    text-align: center;
    width: 20px;
}

.command-item.active,
.command-item:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.14), rgba(6, 182, 212, 0.055), transparent),
        rgba(255, 255, 255, 0.025);
    border-color: rgba(129, 140, 248, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    color: #fff;
    transform: translateX(2px);
}

.command-item.active::before,
.command-item:hover::before {
    opacity: 1;
}

.command-item.selected {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.09), rgba(255, 255, 255, 0.025)),
        rgba(99, 102, 241, 0.045);
    border-color: rgba(129, 140, 248, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 3px 0 12px rgba(99, 102, 241, 0.06),
        0 0 18px rgba(99, 102, 241, 0.055);
    color: #fff;
}

.command-item.selected i {
    color: #a5f3fc;
    filter: drop-shadow(0 0 9px rgba(34, 211, 238, 0.4));
}

.command-item.selected::before {
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.5);
    opacity: 1;
    width: 3px;
}

.command-item.selected:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.27), rgba(6, 182, 212, 0.11), rgba(255, 255, 255, 0.035)),
        rgba(99, 102, 241, 0.06);
    border-color: rgba(129, 140, 248, 0.38);
}

.command-item::before {
    background: linear-gradient(180deg, #818cf8, #22d3ee);
    border-radius: 99px;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
    content: "";
    height: 60%;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 20%;
    transition: opacity 0.2s ease;
    width: 2px;
}

.command-list {
    max-height: 430px;
    overflow: auto;
    padding: 9px;
}

.command-palette {
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.13), transparent 32%),
        radial-gradient(circle at 18% 45%, rgba(6, 182, 212, 0.055), transparent 28%),
        radial-gradient(circle at 82% 55%, rgba(236, 72, 153, 0.045), transparent 30%), rgba(2, 3, 8, 0.76);
    display: grid;
    inset: 0;
    opacity: 0;
    overflow: hidden;
    padding: 24px;
    place-items: center;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.24s ease,
        visibility 0.24s ease;
    visibility: hidden;
    z-index: 10000;
}

.command-palette.open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.command-palette.open .command-box {
    box-shadow: 0 44px 110px rgba(0, 0, 0, 0.66),
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset,
        0 0 90px rgba(99, 102, 241, 0.11);
    transform: none;
}

.command-palette::before {
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.018) 45%, transparent 65%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.command-search {
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
    display: flex;
    gap: 12px;
    padding: 17px 17px 16px;
    position: relative;
}

.command-search input {
    background: transparent;
    border: 0;
    color: #fff;
    flex: 1;
    font: inherit;
    min-width: 0;
    outline: 0;
}

.command-search input::placeholder {
    color: rgba(203, 207, 221, 0.5);
}

.command-search kbd {
    color: #aeb4c8;
}

.command-search>i {
    color: #67e8f9;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.42));
    width: 18px;
}

.command-trigger {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)), rgba(10, 12, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 6px 22px rgba(0, 0, 0, 0.16);
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    isolation: isolate;
    min-height: 42px;
    overflow: hidden;
    padding: 0 10px;
    position: relative;
    transition: transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.command-trigger:focus-visible {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.25);
    outline: none;
}

.command-trigger:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.055)), rgba(10, 12, 20, 0.7);
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11),
        0 10px 30px rgba(0, 0, 0, 0.25),
        0 0 28px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.command-trigger:hover::before {
    opacity: 1;
}

/* ================================================================
   RESPONSIVO / PREFERÊNCIAS · @media (max-width: 600px)
   ================================================================ */

@media (max-width: 600px) {
    /* PALETA DE COMANDOS */
    .command-box {
    border-radius: 17px;
    width: min(650px, calc(100% - 18px));
}
    .command-hint {
        display: none;
    }
    .command-palette {
        padding: 12px;
    }
    .command-trigger {
        min-height: 40px;
    }
    .command-trigger kbd:first-child {
        display: none;
    }
}

/* ================================================================
   RESPONSIVO / PREFERÊNCIAS · @media (prefers-reduced-motion: reduce)
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    /* PALETA DE COMANDOS */
    .command-box,
    .command-item,
    .command-palette,
    .command-trigger {
        transition: none;
    }
}
