:root {
    --primary: #d946ef;
    --primary-glow: rgba(217, 70, 239, 0.4);
    --bg-dark: #0a0a0c;
    --bg-card: #222226;
    --text-main: #fafafa;
    --text-dim: #a1a1aa;
    --border: rgba(255, 255, 255, 0.12);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 6px;
}

@media (max-width: 768px) {
    :root {
        --radius-lg: 16px;
        --radius-md: 10px;
    }
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 10%, rgba(217, 70, 239, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(217, 70, 239, 0.03) 0%, transparent 40%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.modal-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-title-group {
    flex: 1;
    min-width: 200px;
}

.modal-actions-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#chart-search {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    width: 250px;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

#chart-search:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.brand-container {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ig-link {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.ig-link:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    min-width: 300px;
}

.brand-h {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-h span {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }

    header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-bottom: 2rem;
        text-align: center;
    }

    .brand-h {
        font-size: 1.5rem;
    }

    .header-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.75rem;
        -webkit-overflow-scrolling: touch;
        display: flex;
        gap: 0.5rem;
        scrollbar-width: none;
        justify-content: flex-start;
        padding: 0 0.5rem 0.5rem;
    }

    .header-actions::-webkit-scrollbar {
        display: none;
    }

    .header-actions .btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}


/* Premium Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    color: var(--text-main);
    background: #2d2d31;
}

.btn-install-mini {
    background: rgba(217, 70, 239, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-install-mini:hover {
    background: var(--primary);
    color: white;
}

.btn-small {
    padding: 4px 12px !important;
    font-size: 0.7rem !important;
    min-width: unset !important;
}

.btn-primary {
    background: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #e879f9;
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.btn-tab:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.btn-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.tab-content {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.hidden {
    display: none;
}

/* Grid Layout */
.bridge-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.processing-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 2rem;
    border-radius: 50px;
    color: var(--primary);
    font-weight: 800;
    z-index: 100;
    display: none;
    animation: pulse 1.5s infinite;
    border: 1px solid var(--primary);
}

@media (max-width: 1200px) {
    .bridge-grid {
        grid-template-columns: 1fr;
    }
}

/* Drop Zone Premium */
.drop-zone {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 5rem 2rem;
    text-align: center;
    transition: all 0.4s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(217, 70, 239, 0.02);
}

.drop-zone.active {
    border-color: var(--primary);
    background: rgba(217, 70, 239, 0.05);
}

.drop-zone .icon-box {
    width: 80px;
    height: 80px;
    background: rgba(217, 70, 239, 0.1);
    color: var(--primary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 2rem;
    box-shadow: 0 0 30px rgba(217, 70, 239, 0.2);
}

.drop-zone h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-dim);
}

/* Visualizer Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.controls-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
}

.controls-group input[type="range"] {
    accent-color: var(--primary);
    width: 120px;
}

@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }

    .controls-group {
        width: 100%;
        justify-content: space-between;
    }

    .controls-group input[type="range"] {
        flex-grow: 1;
    }
}

/* Palette Swatches */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .brand-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.5rem;
    }
}

.dashboard-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

#dash-project-settings {
    background: linear-gradient(145deg, rgba(25, 25, 28, 0.9), rgba(20, 20, 22, 0.95));
    transition: transform 0.3s ease;
}

#dash-project-settings:hover {
    transform: translateY(-2px);
}

#project-summary {
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 12px;
}

@media (max-width: 480px) {
    .dashboard-palette {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }
}


.palette-swatch {
    height: 150px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    position: relative;
    border: 1px solid var(--border);
    background-size: cover;
}

@media (max-width: 480px) {
    .palette-swatch {
        height: 100px;
        padding: 0.5rem;
    }

    .swatch-hex {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}


.palette-swatch:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.palette-swatch.selected {
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.swatch-hex {
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

/* Tech Specs Panel */
.tech-specs {
    position: sticky;
    top: 2rem;
}

.spec-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary);
}

.spec-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.spec-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.spec-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    word-break: break-all;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 400px) {
    .spec-grid {
        grid-template-columns: 1fr;
    }
}


/* Texture/Finish Module */
.texture-btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.5rem;
}

.texture-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#texture-preview-box {
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Interactive Picker */
#picker-canvas {
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

/* Utilities */
.text-magenta {
    color: var(--primary);
}

.bg-magenta {
    background-color: var(--primary);
}

/* Harmony Section Styles */
.harmony-badge {
    background: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

.harmony-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.harmony-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

@media (max-width: 600px) {
    .table-container {
        overflow-x: auto;
    }

    .harmony-table {
        min-width: 500px;
    }
}


.harmony-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.harmony-table td {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.9rem;
}

.harmony-table tr td:first-child {
    border-radius: 12px 0 0 12px;
}

.harmony-table tr td:last-child {
    border-radius: 0 12px 12px 0;
}

.correction-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.tag-add {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid #4ade80;
}

.tag-reduce {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #f87171;
}

.tag-neutral {
    background: rgba(161, 161, 170, 0.2);
    color: #d4d4d8;
    border: 1px solid #d4d4d8;
}

/* Comparison Slider Specifics */
#comparison-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    cursor: crosshair;
    user-select: none;
    max-height: 70vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#original-viz-canvas {
    width: 100%;
    max-height: inherit;
    display: block;
    object-fit: contain;
}

#processed-reveal-box {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    overflow: hidden;
    border-right: 3px solid var(--primary);
    transition: width 0.1s ease-out;
    display: flex;
    align-items: center;
}

#processed-viz-canvas {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
}

@media (max-width: 768px) {
    #comparison-slider-container {
        max-height: 50vh;
    }
}

#comparison-slider-container:hover #slider-handle {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 25px var(--primary-glow);
}


#slider-handle {
    transition: transform 0.2s, box-shadow 0.2s, left 0.1s ease-out;
}

.palette-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.palette-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary) !important;
}

.palette-card.manual-pick {
    background: linear-gradient(145deg, #1e1e21, #18181b) !important;
    border-style: dashed !important;
}

.btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.palette-card:hover .btn-remove {
    opacity: 1;
}

.btn-remove:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* Modal Glassmorphism */
#chart-modal,
#cam-modal,
#harmony-modal-view {
    backdrop-filter: blur(15px);
    background: rgba(9, 9, 11, 0.85);
    /* Zinc 950 with translucency */
}

/* Fluid Responsiveness for Pro-Dash */
@media (max-width: 1200px) {
    .tech-specs {
        position: static;
        width: 100%;
        margin-top: 2rem;
    }
}

#chart-grid {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    align-content: start;
}

@media (max-width: 768px) {
    #comparison-section h3 {
        font-size: 1rem;
    }

    #comparison-section .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }





    @media (max-width: 768px) {
        #chart-grid {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
            padding: 1rem !important;
            gap: 0.75rem !important;
        }

        .palette-card {
            padding: 0.5rem !important;
        }
    }

    #chart-modal h3,
    #harmony-modal-view h3 {
        font-size: 1rem;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-actions-group {
        width: 100%;
        order: 2;
    }

    #chart-search {
        width: 100%;
        font-size: 0.8rem;
    }

    .modal-actions-group .btn {
        flex: 1;
        padding: 0.5rem;
    }

    #explorer-brand-manager {
        padding: 0.5rem 1rem !important;
    }
}

/* Harmony & Gradient Micro-Animations */
#harmonies-container .card div div:hover,
#gradient-steps-container div:hover {
    transform: scale(1.15);
    z-index: 5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: var(--primary) !important;
}

#harmonies-container .card div div,
#gradient-steps-container div {
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* AR HUD Elements */
#ar-hud-elements {
    animation: arFadeIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes arFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#ar-info-bubble {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-glow);
    transition: all 0.2s ease;
}

.ar-swatch {
    transition: background-color 0.15s ease, transform 0.2s ease;
}

@keyframes reticlePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    50% {
        transform: scale(1.8);
        box-shadow: 0 0 20px 5px var(--primary-glow);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--primary-glow);
    }
}