.gate-designer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Roboto', sans-serif;
}

.gate-designer-container header {
    text-align: center;
    margin-bottom: 40px;
}

.gate-designer-container h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.gate-designer-container h2 {
    color: #444;
    margin-bottom: 30px;
    font-size: 24px;
}

.gate-designer-container h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    margin: 0 auto 40px;
    max-width: 800px;
    position: relative;
    padding: 0 20px;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.step {
    background: #fff;
    color: #666;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    position: relative;
    z-index: 2;
    border: 2px solid #ddd;
    margin: 0 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step.active {
    background: #4a90e2;
    color: #fff;
    border-color: #4a90e2;
}

.step.completed {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

/* Design Area */
.design-area {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    position: relative;
}

.controls-section {
    flex: 0 0 400px;
    max-width: 400px;
}

.preview-section {
    flex: 1;
    position: sticky;
    top: 20px;
    height: fit-content;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Step Content */
.step-content {
    display: none;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.step-content.active {
    display: block;
}

.control-group {
    margin-bottom: 25px;
}

/* Form Controls */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    appearance: none;
    background: #fff url('data:image/svg+xml;utf8,<svg fill="%23444" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-group label {
    flex: 1 1 calc(50% - 6px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.radio-group label:hover {
    border-color: #4a90e2;
    background: #f8f9fa;
}

.radio-group input[type="radio"] {
    margin: 0;
}

.radio-group input[type="radio"]:checked + label {
    border-color: #4a90e2;
    background: #f0f7ff;
}

/* Preview Area */
.preview-area {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-container {
    position: relative;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    margin-top: 20px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f8f8;
}

.dimensions-display {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.button-primary,
.button-secondary {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button-primary {
    background-color: #007bff;
    color: white;
    border: none;
}

.button-primary:hover {
    background-color: #0056b3;
}

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

.button-secondary:hover {
    background-color: #e2e6ea;
    color: #4a4a4a;
}

/* Top Style Options */
.top-style-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.top-style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
}

.top-style-option:hover {
    border-color: #007cba;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-style-option input[type="radio"] {
    margin-bottom: 5px;
}

.top-style-option img {
    width: 100px;
    height: 60px;
    object-fit: contain;
    margin: 5px 0;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 3px;
}

.top-style-option span {
    margin-top: 5px;
    font-size: 14px;
}

.top-style-option input[type="radio"]:checked + img + span {
    color: #007cba;
    font-weight: bold;
}

.top-style-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background-color: #f0f7ff;
}

/* Color Selection Styles */
.color-selection-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.color-selection-wrapper .select-wrapper {
    flex: 1;
}

.color-swatch {
    width: 64px;
    height: 64px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.color-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 240, 240, 0.95); /* Very light gray background */
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border: 1px solid #ddd; /* Light border around the image */
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: #ffffff;
    border: 2px solid #333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    color: #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
}

.lightbox-close:hover {
    background-color: #f0f0f0;
}

/* Make the preview image clickable */
#preview-image {
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gate-designer-container {
        padding: 15px;
    }

    .design-area {
        flex-direction: column;
    }

    .controls-section {
        flex: none;
        max-width: 100%;
    }

    .preview-section {
        position: relative;
        top: 0;
        order: -1;
    }

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

@media (max-width: 768px) {
    .gate-designer-container {
        padding: 10px;
    }

    .step-indicator {
        display: none;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-group label {
        flex: 1 1 100%;
    }

    .preview-container {
        aspect-ratio: 4/3;
    }

    .button-primary,
    .button-secondary {
        min-width: 120px;
        padding: 10px 20px;
    }
}
