/* public/assets/css/spotlight.css */

.spotlight-wrapper {
    --spotlight-title-size: 11px;
    --spotlight-title-weight: 600;
    --spotlight-title-color: #6b7280;
    
    --spotlight-value-size: 24px;
    --spotlight-value-weight: 700;
    --spotlight-value-color: #111827;

    --spotlight-subtitle-size: 13px;
    --spotlight-subtitle-weight: 500;
    --spotlight-subtitle-color: #6b7280;

    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.spotlight-wrapper.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.spotlight-card-title {
    font-size: var(--spotlight-title-size);
    font-weight: var(--spotlight-title-weight);
    color: var(--spotlight-title-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spotlight-card-value {
    font-size: var(--spotlight-value-size);
    font-weight: var(--spotlight-value-weight);
    color: var(--spotlight-value-color);
}

.spotlight-card-subtitle {
    font-size: var(--spotlight-subtitle-size);
    font-weight: var(--spotlight-subtitle-weight);
    color: var(--spotlight-subtitle-color);
}

/* 
 * The actual command palette window
 * Clean, minimalistic Apple/Notion design 
 */
.spotlight-palette {
    background-color: rgb(252, 252, 252);
    width: 100%;
    max-width: 640px;
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    
    /* Smooth Apple-style scaling animation */
    transform: scale(0.97);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-wrapper.is-open .spotlight-palette {
    transform: scale(1);
}

/* Dark mode support if applicable */
html[data-theme="dark"] .spotlight-palette {
    background-color: #1e1e1e;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Header / Search Area */
.spotlight-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .spotlight-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spotlight-icon {
    color: #8c8c8c;
    margin-right: 12px;
    font-size: 24px;
    display: flex;
    align-items: center;
}

.spotlight-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 20px;
    font-family: inherit;
    color: #111;
    font-weight: 400;
}

.spotlight-input:focus,
.spotlight-input:focus-visible,
.spotlight-input:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.spotlight-input::placeholder {
    color: #a0a0a0;
}

html[data-theme="dark"] .spotlight-input {
    color: #fff;
}

/* Results Area */
.spotlight-results {
    padding: 8px;
    max-height: calc(58vh - 60px);
    overflow-y: auto;
    scroll-behavior: smooth;
}

@keyframes spotlightResultEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.spotlight-results > div {
    animation: spotlightResultEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.spotlight-group-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #8c8c8c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spotlight-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    transition: background-color 0.1s ease;
}

html[data-theme="dark"] .spotlight-item {
    color: #eee;
}

.spotlight-item:hover, .spotlight-item.is-selected {
    background-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .spotlight-item:hover, 
html[data-theme="dark"] .spotlight-item.is-selected {
    background-color: rgba(255, 255, 255, 0.08);
}

.spotlight-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #f5f5f5;
    border-radius: 6px;
    margin-right: 12px;
    color: #555;
}

html[data-theme="dark"] .spotlight-item-icon {
    background-color: #2a2a2a;
    color: #ccc;
}

.spotlight-item-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.spotlight-item-shortcut {
    font-size: 12px;
    color: #999;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

html[data-theme="dark"] .spotlight-item-shortcut {
    background-color: #333;
    color: #aaa;
}

#spotlight-history-btn:hover {
    color: rgb(38, 38, 38) !important;
}

@keyframes bubbleBounceSmooth {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; }
    40% { transform: scale(1.02) translateY(-2px); opacity: 0.8; }
    70% { transform: scale(0.98) translateY(1px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.spotlight-user-query-bubble {
    animation: bubbleBounceSmooth 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transform-origin: right bottom;
}

.spotlight-csv-btn:hover { background: var(--surface-hover, #f9fafb) !important; }
.spotlight-bar-item { opacity: 0.85; transition: opacity 0.2s, width 0.5s ease-out; }
.spotlight-bar-item:hover { opacity: 1 !important; }
.spotlight-heatmap-cell { transition: transform 0.2s; }
.spotlight-heatmap-cell:hover { transform: scale(1.05); }

.spotlight-table-row { transition: background 0.2s; }
.spotlight-table-row:hover { background: var(--surface-hover, #f9fafb); }

/* Spotlight Analytics Grid */
.spotlight-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}
.spotlight-analytics-grid.spotlight-analytics-single {
    grid-template-columns: 1fr;
}

.spotlight-analytics-card {
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    position: relative;
}

/* Default Colored Card Fallback */
.spotlight-analytics-card-default {
    background-color: #f3f4f6;
}
.spotlight-analytics-card-default .spotlight-analytics-label { color: #6b7280; }
.spotlight-analytics-card-default .spotlight-analytics-desc { color: #9ca3af; }
.spotlight-analytics-card-default .spotlight-analytics-value { color: #111827; }
.spotlight-analytics-card-default .spotlight-analytics-icon { color: #9ca3af; }

/* Single Card styling */
.spotlight-analytics-card-single {
    background-color: #f3f4f6;
}
.spotlight-analytics-card-single .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-analytics-card-single .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-analytics-card-single .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-analytics-card-single .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

/* Internal components */
.spotlight-analytics-header {
    margin-bottom: 24px;
}
.spotlight-analytics-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: inherit;
}
.spotlight-analytics-desc {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: inherit;
}

.spotlight-analytics-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.spotlight-analytics-icon {
    display: flex;
    align-items: center;
    color: inherit;
}

.spotlight-analytics-value-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.spotlight-analytics-value-container.spotlight-analytics-stacked {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.spotlight-analytics-top-value {
    font-size: 56px;
    font-weight: 500;
    color: rgba(38, 38, 38, 0.4);
    line-height: 0.9;
    letter-spacing: -1.5px;
}

.spotlight-analytics-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.spotlight-analytics-value {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.5px;
}

.spotlight-analytics-value.spotlight-analytics-value-secondary {
    font-size: 26px !important;
}

.spotlight-analytics-unit {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

.spotlight-analytics-sub {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    display: flex;
    gap: 16px;
}
.spotlight-analytics-sub-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.6;
    color: inherit;
}
.spotlight-analytics-sub-value {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
}

/* TOTAL_SALES Card */
.spotlight-card-total-sales {
    background-color: #d4e9ff;
}

/* TOTAL_TURNOVER & TOTAL_REVENUE Card */
.spotlight-card-total-turnover,
.spotlight-card-total-revenue {
    background-color: #e6f7ea;
}
.spotlight-card-total-sales .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-card-total-sales .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-card-total-sales .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-card-total-sales .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

/* REDEEMED_COUPONS Card */
.spotlight-card-redeemed-coupons {
    background-color: #ffe7b0;
}
.spotlight-card-redeemed-coupons .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-card-redeemed-coupons .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-card-redeemed-coupons .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-card-redeemed-coupons .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

/* REDEMPTION_RATE Card */
.spotlight-card-redemption-rate {
    background-color: #e9f2af;
}
.spotlight-card-redemption-rate .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-card-redemption-rate .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-card-redemption-rate .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-card-redemption-rate .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

/* SOLD_COUPONS Card */
.spotlight-card-sold-coupons {
    background-color: #fff6e3;
}
.spotlight-card-sold-coupons .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-card-sold-coupons .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-card-sold-coupons .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-card-sold-coupons .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

/* OUTSTANDING_LIABILITY Card */
.spotlight-card-outstanding-liability {
    background-color: #dfe9f2;
}
.spotlight-card-outstanding-liability .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-card-outstanding-liability .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-card-outstanding-liability .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-card-outstanding-liability .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

/* MOST_SOLD_COUPON Card */
.spotlight-card-most-sold-coupon {
    background-color: #fff4d2;
}
.spotlight-card-most-sold-coupon .spotlight-analytics-label {
    color: rgb(38, 38, 38);
}
.spotlight-card-most-sold-coupon .spotlight-analytics-desc {
    color: rgba(38, 38, 38, 0.5);
}
.spotlight-card-most-sold-coupon .spotlight-analytics-value {
    color: rgba(38, 38, 38, 1);
    font-size: 34px;
}
.spotlight-card-most-sold-coupon .spotlight-analytics-icon {
    color: rgba(38, 38, 38, 0.5);
    font-size: 34px;
}

.spotlight-analytics-card-wide {
    grid-column: 1 / -1;
}
