:root {
    --bg-top: #005D50;
    --bg-bottom: #00382E;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-primary-translucent: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-color: #4DB6AC;
    --accent-glow: rgba(77, 182, 172, 0.4);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --font-header: 'Sanchez', serif;
    --font-body: 'Montserrat', sans-serif;
    --top-bar-height: 80px;
    --bottom-bar-height: 80px;
    --transition-speed: 0.3s;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Glass Utilities */
.glass-panel {
    background: rgba(20, 40, 40, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

/* Header */
.top-bar {
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 10;
    border-bottom: 1px solid var(--glass-border);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-placeholder {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--bg-bottom);
    font-family: var(--font-header);
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.app-title {
    font-family: var(--font-header);
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-primary-translucent);
}

/* Wizard Steps */
.wizard-steps {
    display: flex;
    gap: 4px;
}

.step-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 20px;
    cursor: default;
    transition: all var(--transition-speed) ease;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.step-tab.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.08), transparent);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.step-tab.completed {
    color: var(--text-secondary);
    cursor: pointer;
}

.step-tab.completed:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    width: 100%;
    height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height));
    padding: 30px 50px;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

/* Left: Preview */
.preview-area {
    width: 65%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-bottom: 40px;
}

.preview-container {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: transparent;
    /* Clean appearance for the product */
    box-shadow: none;
    border: none;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.product-name {
    margin-top: 0;
    font-family: var(--font-header);
    font-size: 2.2rem;
    text-align: center;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.design-name {
    position: absolute;
    bottom: -10px;
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Right: Menu Panel */
.menu-panel {
    width: 35%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-bottom: 10px;
}

.menu-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.1);
}

.step-title {
    font-family: var(--font-header);
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 400;
}

.menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Option Grids */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-2 {
    grid-template-columns: 1fr 1fr;
}

/* Option Card */
.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    text-align: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Selected state */
.option-card.selected {
    border: 2px solid white;
    /* Bright white border as per typical car configurators or request */
    background: rgba(77, 182, 172, 0.15);
    box-shadow: 0 0 20px rgba(77, 182, 172, 0.3);
}

.option-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 8px;
}

.option-label {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Category Cards specific design */
.category-card {
    min-height: 160px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 24px;
    text-align: left;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.category-card .option-label {
    font-size: 1.4rem;
    font-family: var(--font-header);
}

/* Color Swatch specific */
.swatch-card {
    min-height: 110px;
    padding: 16px;
}

.color-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.option-card.selected .color-circle {
    border-color: white;
    transform: scale(1.1);
}

/* Output steps */
.summary-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    font-size: 1rem;
    line-height: 1.8;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
}

.summary-line:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 600;
    color: var(--accent-color);
    text-align: right;
}

.output-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-btn {
    padding: 24px;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Footer */
.bottom-bar {
    height: var(--bottom-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    background: rgba(0, 30, 25, 0.4);
    backdrop-filter: blur(10px);
}

.glass-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: var(--font-header);
    padding: 14px 40px;
    border-radius: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1.5px;
    min-width: 140px;
    text-transform: uppercase;
}

.glass-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--text-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.glass-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: none;
}

/* Scrollbar */
.scrollbar-custom::-webkit-scrollbar {
    width: 8px;
}

.scrollbar-custom::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: #00382E;
    background: linear-gradient(135deg, #004D40, #00251E);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 40px;
    width: 700px;
    max-width: 90%;
    text-align: center;
    position: relative;
    color: white;
    border-radius: var(--radius-lg);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.close-modal:hover {
    color: white;
}

.code-wrapper {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
    max-height: 400px;
    overflow: auto;
    font-family: 'Fira Code', monospace;
    /* fallback monospace is fine */
    font-size: 0.9rem;
    color: #80CBC4;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.design-pattern-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.hidden {
    display: none;
}