/**
 * ==============================================================================
 * FeelingsWheels - 5-Tab Control Panel & List Row Styling (Fully Responsive)
 * ==============================================================================
 * File: assets/css/panel.css
 */

.side-panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: clamp(0.75rem, 2.5vw, 1.25rem);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.panel-seo-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.seo-main-h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.seo-main-h1 .text-accent {
    color: var(--accent-mint);
}

.seo-sub-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.panel-utility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.5rem;
}

.badge-wheel-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0, 229, 153, 0.08);
    border: 1px solid rgba(0, 229, 153, 0.25);
    color: var(--accent-mint);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.util-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-util-text {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    white-space: nowrap;
}

.results-count-pill {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--accent-cyan);
}

.more-tools-wrapper {
    position: relative;
}

.tools-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    display: none;
    flex-direction: column;
    z-index: 100;
}

.tools-dropdown-menu.is-open {
    display: flex;
}

.dropdown-action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
}

.dropdown-action-item:hover {
    background: var(--bg-elevated);
}

.dropdown-action-item.text-danger {
    color: var(--accent-danger);
}

/* ==========================================================================
   5 Main Tabs (Never Overflow / Never Slide)
   ========================================================================== */
.panel-tabs-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    background: var(--bg-input);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    width: 100%;
    box-sizing: border-box;
}

.tab-nav-btn {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.45rem 0.2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: clamp(0.7rem, 1.8vw, 0.825rem);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-nav-btn svg,
.tab-nav-btn i {
    flex-shrink: 0;
    font-size: 0.85em;
}

.tab-nav-btn.is-active {
    background: var(--bg-card);
    border-color: rgba(0, 229, 153, 0.4);
    color: var(--accent-mint);
}

/* Tab Panes */
.tab-content-wrapper {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.tab-pane.is-active {
    display: flex;
}

.tab-pane-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-subbar-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

/* List Rows */
.entries-list-scrollable {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-right: 0.2rem;
}

.entry-row-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.5rem;
}

.entry-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-mint);
    cursor: pointer;
    flex-shrink: 0;
}

.entry-text-input {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.weight-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.btn-step {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    width: 22px;
    height: 26px;
    cursor: pointer;
}

.weight-val {
    padding: 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 18px;
    text-align: center;
}

.percent-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.color-dot-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #FFFFFF;
    flex-shrink: 0;
}

.btn-entry-dots {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 0 0.15rem;
    flex-shrink: 0;
}

.add-entry-row {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.input-new-entry {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.btn-add-entry {
    background: var(--accent-mint);
    color: #0B0F14;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
}

.bulk-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
}

.styles-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.45rem;
}

.style-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.style-card.is-active {
    border-color: var(--accent-mint);
    background: rgba(0, 229, 153, 0.08);
}

.style-preview-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    position: relative;
    border: 2px solid #FFFFFF;
}

.style-preview-circle.style-default { background: conic-gradient(#3B82F6, #10B981, #F59E0B, #EF4444, #EC4899, #8B5CF6); }
.style-preview-circle.style-golden { background: conic-gradient(#F59E0B, #D97706, #B45309, #FBBF24, #FCD34D); }
.style-preview-circle.style-neon { background: conic-gradient(#00F0FF, #FF007F, #7928CA, #00FF66, #FFDD00); }
.style-preview-circle.style-gem { background: conic-gradient(#38BDF8, #818CF8, #C084FC, #F472B6); }
.style-preview-circle.style-wedding { background: conic-gradient(#FDA4AF, #F43F5E, #FB7185, #FECDD3); }
.style-card-name { font-size: 0.72rem; font-weight: 700; color: var(--text-primary); }

.sound-selectors-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sound-select-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sound-label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }

.custom-select-box {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.timing-slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    outline: none;
}

.custom-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-mint);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-mint-glow);
}

.panel-bottom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-action-ai,
.btn-action-cloud {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.4rem;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: clamp(0.78rem, 1.8vw, 0.85rem);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-action-ai { background: rgba(0, 229, 153, 0.1); border: 1px solid rgba(0, 229, 153, 0.3); color: var(--accent-mint); }
.btn-action-cloud { background: rgba(56, 225, 255, 0.1); border: 1px solid rgba(56, 225, 255, 0.3); color: var(--accent-cyan); }

/* ==========================================================================
   Mobile & Tablet Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
    .panel-tabs-nav {
        gap: 2px;
        padding: 2px;
    }

    .tab-nav-btn {
        padding: 0.4rem 0.15rem;
        font-size: 0.72rem;
        gap: 0.2rem;
    }

    .entry-row-item {
        padding: 0.3rem 0.4rem;
        gap: 0.3rem;
    }

    .entry-text-input {
        font-size: 0.8rem;
        padding: 0.25rem 0.4rem;
    }

    .btn-step {
        width: 18px;
        height: 22px;
        font-size: 0.75rem;
    }

    .weight-val {
        padding: 0 0.15rem;
        font-size: 0.72rem;
        min-width: 14px;
    }

    .percent-badge {
        font-size: 0.68rem;
        min-width: 24px;
    }

    .color-dot-circle {
        width: 16px;
        height: 16px;
    }

    .styles-cards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.3rem;
    }

    .style-card {
        padding: 0.35rem 0.15rem;
    }

    .style-preview-circle {
        width: 32px;
        height: 32px;
    }

    .style-card-name {
        font-size: 0.62rem;
    }
}

/* Chhoti screens (iPhone SE, Galaxy A / Fold: <= 375px) */
@media (max-width: 375px) {
    .panel-tabs-nav {
        gap: 2px;
        padding: 2px;
    }

    .tab-nav-btn {
        padding: 0.35rem 0.1rem;
        font-size: 0.68rem;
        flex-direction: column; /* Icon upar, text neeche bina truncate hue */
        gap: 0.15rem;
    }

    .tab-nav-btn svg,
    .tab-nav-btn i {
        font-size: 0.9em;
    }

    .badge-wheel-name {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* -------------------------------------------------------------------------- */
/* DYNAMIC WHEEL MODES PILLS (Active Button Highlight)                        */
/* -------------------------------------------------------------------------- */
.wheel-modes-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 0.5rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.modes-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.modes-buttons-track {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.btn-mode-pill {
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn-mode-pill:hover {
    border-color: var(--accent-mint);
    color: var(--text-primary);
}

/* Jo mode active hoga uska button Neon Mint Green me chamkega! */
.btn-mode-pill.is-active {
    background: var(--accent-mint) !important;
    border-color: var(--accent-mint) !important;
    color: #0B0F14 !important;
    font-weight: 800;
    box-shadow: 0 0 12px var(--accent-mint-glow);
}



.side-panel-card.is-locked {
    pointer-events: none !important; /* Saare clicks aur typing 100% block ho jayenge */
    user-select: none !important;
    opacity: 0.65 !important;        /* Halka sa dim hokar bataega ki abhi lock hai */
    cursor: not-allowed !important;
    transition: opacity 0.2s ease;
}


/* Slice Counter ke number ka color badalne ke liye */
/* -------------------------------------------------------------------------- */
/* SLICE COUNTER NUMBER COLOR (Dark & Light Mode Safe)                        */
/* -------------------------------------------------------------------------- */

/* Default / Dark Mode: Chamakta hua Electric Mint (#00E599) */
#slices-count-text {
    color: var(--accent-mint);
    font-weight: 800;
}

/* Super crisp & safe for any off-white/light-grey background */
[data-theme="light"] #slices-count-text {
    color: #047857; /* Emerald-700 (Contrast ratio ~5.8:1) */
}