/* Cutting Board Designer Frontend Styles */

.cbd-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Progress Bar */
.cbd-progress-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    color: white;
}

.cbd-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.cbd-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.cbd-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    right: -40%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.cbd-progress-step.active::after,
.cbd-progress-step.completed::after {
    background: rgba(255, 255, 255, 0.8);
}

.cbd-progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.cbd-progress-step.active .cbd-progress-step-circle {
    background: white;
    color: #667eea;
}

.cbd-progress-step.completed .cbd-progress-step-circle {
    background: #4CAF50;
    color: white;
}

.cbd-progress-step-label {
    font-size: 14px;
    opacity: 0.8;
}

.cbd-progress-step.active .cbd-progress-step-label,
.cbd-progress-step.completed .cbd-progress-step-label {
    opacity: 1;
    font-weight: 500;
}

/* Step Container */
.cbd-step {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.cbd-step-container {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.cbd-step-content {
    flex: 1;
    padding: 40px;
}

.cbd-step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Welcome Step */
.cbd-welcome-hero {
    text-align: center;
    margin-bottom: 60px;
}

.cbd-welcome-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.cbd-welcome-hero p {
    font-size: 1.2rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 30px;
}

.cbd-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.cbd-feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.cbd-feature-card:hover {
    transform: translateY(-5px);
}

.cbd-feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.cbd-feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.cbd-feature-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* Choose Design Step */
.cbd-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.cbd-section-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.cbd-section-header p {
    font-size: 1.1rem;
    color: #6c757d;
}

.cbd-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.cbd-preset-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.cbd-preset-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.cbd-preset-card.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.cbd-preset-card.selected-animation {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.cbd-preset-preview {
    height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cbd-preset-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.cbd-preset-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.cbd-preset-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
}

.cbd-preset-difficulty {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.cbd-preset-difficulty.simple {
    background: #d4edda;
    color: #155724;
}

.cbd-preset-difficulty.intermediate {
    background: #fff3cd;
    color: #856404;
}

.cbd-preset-difficulty.advanced {
    background: #f8d7da;
    color: #721c24;
}

/* Customize Step */
.cbd-customize-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

/* Tabbed Interface */
.cbd-tabbed-interface {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.cbd-tab-header {
    display: flex;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.cbd-tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cbd-tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #495057;
}

.cbd-tab-button.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

.cbd-tab-pane {
    display: none;
    padding: 20px;
    background: white;
    min-height: 500px;
}

.cbd-tab-pane.active {
    display: block;
}

/* 3D Preview Controls */
.cbd-preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cbd-view-controls {
    display: flex;
    align-items: center;
}

/* Canvas Zoom Controls */
.cbd-canvas-zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    pointer-events: auto;
}

.cbd-canvas-zoom-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbd-canvas-zoom-button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cbd-canvas-zoom-button:active {
    transform: scale(0.95);
}

.cbd-view-button {
    padding: 10px 18px;
    margin: 0 6px;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cbd-view-button:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cbd-view-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

/* 3D Canvas Container */
.cbd-canvas-container {
    background: #34495e;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.cbd-canvas-container canvas {
    display: block;
    width: 100%;
    height: 400px;
}

.cbd-canvas-fallback {
    color: white;
    text-align: center;
    padding: 40px;
}

.cbd-canvas-loading {
    color: white;
    text-align: center;
    padding: 40px;
}

.cbd-2d-preview {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cbd-2d-board {
    display: flex;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #333;
    margin: 0 auto;
    max-width: 400px;
}

.cbd-2d-strip {
    height: 100%;
    transition: all 0.3s ease;
}

.cbd-2d-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* Strip Editor Styles */
.cbd-strips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.cbd-strips-header h3 {
    margin: 0;
    color: #2c3e50;
}

.cbd-strips-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 200px;
}

.cbd-strip-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    cursor: move;
}

.cbd-strip-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.cbd-strip-item.cbd-dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.cbd-strip-handle {
    color: #6c757d;
    font-size: 18px;
    cursor: grab;
    user-select: none;
}

.cbd-strip-handle:active {
    cursor: grabbing;
}

.cbd-strip-preview {
    height: 30px;
    min-width: 20px;
    max-width: 100px;
    border-radius: 3px;
    border: 1px solid #ccc;
    background: #ddd;
}

.cbd-strip-wood {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.cbd-strip-width {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.cbd-strip-width-label {
    font-weight: 500;
    color: #6c757d;
    margin-left: -8px;
}

.cbd-remove-strip {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.cbd-remove-strip:hover {
    background: #c82333;
}

.cbd-empty-strips {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Strip Summary */
.cbd-strip-summary {
    background: #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.cbd-strip-summary h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.cbd-summary-list {
    margin-bottom: 10px;
}

.cbd-summary-item {
    padding: 4px 0;
    color: #495057;
    font-size: 14px;
}

.cbd-summary-total {
    font-weight: 600;
    color: #2c3e50;
    border-top: 1px solid #ced4da;
    padding-top: 8px;
}

.cbd-empty-state {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.cbd-customize-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.cbd-control-section {
    margin-bottom: 30px;
}

.cbd-control-section:last-child {
    margin-bottom: 0;
}

.cbd-control-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.cbd-control-group {
    margin-bottom: 15px;
}

.cbd-control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.cbd-control-group input,
.cbd-control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.cbd-control-group input:focus,
.cbd-control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cbd-checkbox-group {
    margin-bottom: 10px;
}

.cbd-checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.cbd-checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.cbd-cost-display {
    background: white;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.cbd-cost-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #6c757d;
}

.cbd-cost-total {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.cbd-customize-main {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 30px;
}

.cbd-design-preview h3,
.cbd-strips-editor h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.cbd-preview-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cbd-strips-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

/* Buttons */
.cbd-nav-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cbd-nav-button.cbd-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cbd-nav-button.cbd-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cbd-nav-button.cbd-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cbd-nav-button.cbd-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.cbd-nav-button.cbd-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cbd-container {
        padding: 10px;
    }
    
    .cbd-step-content {
        padding: 20px;
    }
    
    .cbd-step-navigation {
        padding: 15px 20px;
    }
    
    .cbd-welcome-hero h1 {
        font-size: 2rem;
    }
    
    .cbd-feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cbd-preset-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cbd-customize-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cbd-progress-steps {
        flex-direction: column;
        gap: 10px;
    }
    
    .cbd-progress-step:not(:last-child)::after {
        display: none;
    }
    
    /* Mobile preview controls */
    .cbd-preview-controls {
        padding: 10px;
    }
    
    .cbd-view-controls {
        justify-content: center;
    }
    
    .cbd-view-button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 0 3px;
    }
    
    .cbd-canvas-zoom-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .cbd-canvas-zoom-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .cbd-canvas-container {
        min-height: 300px;
    }
}