/**
 * Arcade Configurator Styles
 */

/* Main Container */
.arcade-configurator {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Progress Steps - Scrollable for many steps */
.arcade-steps {
    display: flex;
    overflow-x: auto;
    margin-bottom: 40px;
    padding: 10px 20px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    -webkit-overflow-scrolling: touch;
}

.arcade-steps::-webkit-scrollbar {
    height: 6px;
}

.arcade-steps::-webkit-scrollbar-track {
    background: transparent;
}

.arcade-steps::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
    min-width: 80px;
    text-align: center;
    padding: 0 10px;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.step-item.completed:not(:last-child)::after {
    background: #4CAF50;
}

.step-item.active:not(:last-child)::after {
    background: linear-gradient(90deg, #4CAF50 0%, #e0e0e0 100%);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.step-item.active .step-number {
    background: #2196F3;
    color: white;
    transform: scale(1.1);
}

.step-item.completed .step-number {
    background: #4CAF50;
    color: white;
}

.step-item.clickable {
    cursor: pointer;
}

.step-item.clickable:hover .step-number {
    transform: scale(1.05);
}

.step-name {
    font-size: 11px;
    color: #888;
    max-width: 80px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-item.active .step-name {
    color: #2196F3;
    font-weight: 600;
}

.step-item.completed .step-name {
    color: #4CAF50;
}

/* Main Content Layout */
.arcade-main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-top: 30px;
}

@media (max-width: 1024px) {
    .arcade-main-content {
        grid-template-columns: 1fr;
    }
    
    .arcade-sidebar {
        order: 2;
    }
}

/* Step Content */
.step-content {
    min-height: 500px;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.step-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.step-description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    clear: both;
}

/* Case Size Grid */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.case-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.case-card:hover {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.case-card.selected {
    border-color: #2196F3;
    background: #E3F2FD;
}

.case-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.case-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.case-info h3 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #333;
}

.case-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.case-specs {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.case-price {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    margin: 0;
}

/* Option Groups */
.option-group {
    margin-bottom: 40px;
}

.option-group h3 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #333;
}

.option-group-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.options-list {
    display: grid;
    gap: 12px;
}

/* Options Grid - for multi-step wizard */
.options-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.option-card {
    display: block;
    padding: 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    position: relative;
    overflow: hidden;
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card:hover {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.option-card.selected {
    border-color: #2196F3;
    background: #E3F2FD;
}

.option-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-card-inner {
    display: flex;
    align-items: stretch;
}

/* Option Image */
.option-image {
    width: 100px;
    min-height: 100px;
    flex-shrink: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.option-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 10px;
}

.option-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.option-price {
    font-size: 15px;
    font-weight: 600;
    color: #4CAF50;
    white-space: nowrap;
}

.option-description {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Selection indicator for option cards */
.option-card.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 1;
}

/* Artwork Upload */
.artwork-upload-section {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.upload-zone h4 {
    margin-bottom: 10px;
    color: #333;
}

.dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    background: #fafafa;
}

.dropzone:hover {
    border-color: #2196F3;
    background: #f8f9fa;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
}

.file-types {
    font-size: 12px;
    color: #888;
}

.artwork-note {
    margin-top: 20px;
    padding: 15px;
    background: #FFF3CD;
    border: 1px solid #FFE69C;
    border-radius: 4px;
    color: #856404;
}

/* Review Step */
.review-summary {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

.summary-section {
    margin-bottom: 30px;
}

.summary-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.config-summary {
    display: grid;
    gap: 10px;
}

.summary-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.summary-item strong {
    color: #333;
    margin-right: 8px;
}

/* Customer Form */
.customer-form {
    margin-bottom: 30px;
}

.customer-form h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.form-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input:focus {
    outline: none;
    border-color: #2196F3;
}

.required {
    color: #e53935;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1976D2;
}

.btn-secondary {
    background: #4CAF50;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #388E3C;
}

/* Message */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.message.success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.message.error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* Navigation Buttons */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-prev,
.btn-next {
    padding: 12px 24px;
}

/* Sidebar */
.arcade-sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: 20px;
}

/* Sidebar Navigation Buttons */
.sidebar-navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
}

@media (max-width: 768px) {
    .sidebar-navigation {
        flex-direction: column;
    }
}

/* Preview */
.arcade-preview {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.arcade-preview h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.preview-image {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.preview-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-caption {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Layered Preview Container (Phase 2) */
.preview-image-container {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}

.preview-base-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 0;
}

.preview-overlay-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Price Summary */
.price-summary {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.price-summary h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.price-breakdown {
    display: grid;
    gap: 10px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.price-line.base-price {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.price-line.option-price {
    font-size: 14px;
    color: #666;
}

.price-line.total-price {
    border-top: 2px solid #333;
    padding-top: 12px;
    margin-top: 8px;
    font-size: 18px;
}

.price-line .label {
    flex: 1;
}

.price-line .value {
    font-weight: 600;
    color: #4CAF50;
}

.price-line.total-price .value {
    font-size: 24px;
    color: #2196F3;
}

.quote-required {
    font-style: italic;
    color: #FF9800;
}

/* Alpine.js cloak - prevents flash of unstyled content */
[x-cloak] {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .arcade-configurator {
        padding: 15px;
    }

    .arcade-steps {
        padding: 5px 10px;
        margin-bottom: 20px;
    }

    .step-item {
        min-width: 60px;
        padding: 0 5px;
    }

    .step-name {
        font-size: 10px;
        max-width: 60px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .case-grid,
    .options-grid {
        grid-template-columns: 1fr;
    }

    .option-card-inner {
        flex-direction: column;
    }

    .option-image {
        width: 100%;
        height: 120px;
        min-height: auto;
    }

    .option-content {
        padding: 12px;
    }

    .step-content h2 {
        font-size: 22px;
    }

    .step-description {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .step-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .step-navigation .btn {
        width: 100%;
    }

    .arcade-main-content {
        gap: 20px;
    }

    .review-summary {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .step-item {
        min-width: 50px;
    }

    .step-name {
        display: none;
    }

    .option-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* 3-Column Layout for Option Groups */
.option-group-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Left: Options Menu */
.options-menu {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.options-menu-list {
    display: flex;
    flex-direction: column;
}

.option-menu-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    position: relative;
}

.option-menu-item:last-child {
    border-bottom: none;
}

.option-menu-item:hover {
    background: #f8f9fa;
}

.option-menu-item.selected {
    background: #E3F2FD;
    border-left: 3px solid #2196F3;
}

.option-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-menu-item input[type="radio"],
.option-menu-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-menu-thumbnail {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 12px;
    margin-top: 2px;
}

.option-menu-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.option-menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-menu-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.option-menu-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.option-menu-price {
    font-size: 13px;
    font-weight: 500;
    color: #4CAF50;
}

/* Selection indicator for menu items */
.option-menu-item.selected::after {
    content: '✓';
    position: absolute;
    right: 15px;
    width: 20px;
    height: 20px;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Featured option styling */
.option-menu-item.featured {
    border: 2px solid #FFD700;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
    background: linear-gradient(to right, #FFFEF7, #ffffff);
    margin: 8px 0;
    position: relative;
}

.option-menu-item.featured:hover {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.option-menu-item.featured.selected {
    background: linear-gradient(to right, #FFF9E6, #E3F2FD);
    border-left: 2px solid #FFD700;
}

/* Option menu header for name and badge */
.option-menu-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Featured badge */
.option-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
    white-space: nowrap;
}

.option-featured-badge .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Middle: Preview Area */
.option-preview-area {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.option-preview-image {
    width: 100%;
    aspect-ratio: 16/10;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.option-preview-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.option-preview-placeholder {
    text-align: center;
    color: #999;
}

.option-preview-placeholder .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    opacity: 0.3;
}

.option-preview-placeholder p {
    margin-top: 10px;
    font-size: 14px;
}

.option-preview-details {
    padding: 25px;
}

.option-preview-details h3 {
    font-size: 22px;
    margin: 0 0 15px 0;
    color: #333;
}

.option-preview-full-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

.option-preview-full-description h1,
.option-preview-full-description h2,
.option-preview-full-description h3,
.option-preview-full-description h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.option-preview-full-description h1 {
    font-size: 24px;
}

.option-preview-full-description h2 {
    font-size: 20px;
}

.option-preview-full-description h3 {
    font-size: 18px;
}

.option-preview-full-description ul,
.option-preview-full-description ol {
    margin: 10px 0;
    padding-left: 25px;
}

.option-preview-full-description li {
    margin: 5px 0;
}

.option-preview-full-description a {
    color: #2196F3;
    text-decoration: none;
}

.option-preview-full-description a:hover {
    text-decoration: underline;
}

.option-preview-full-description p {
    margin: 10px 0;
}

.option-preview-full-description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

/* Responsive adjustments for option group layout */
@media (max-width: 1200px) {
    .option-group-layout {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .option-group-layout {
        grid-template-columns: 1fr;
    }

    .options-menu {
        max-height: none;
    }

    .option-menu-item {
        padding: 15px;
    }

    .option-preview-image {
        aspect-ratio: 16/9;
    }
}

@media (max-width: 768px) {
    .option-menu-thumbnail {
        width: 40px;
        height: 40px;
    }

    .option-preview-details {
        padding: 20px;
    }

    .option-preview-details h3 {
        font-size: 18px;
    }

    .option-preview-full-description {
        font-size: 14px;
    }
}