/* Base styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
    box-sizing: border-box;
}

/* Main container */
#configurator {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
}

/* Header */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

/* Frame container and image styles */
#mainFrameContainer {
    position: relative;
    margin: 20px auto;
    width: 100%;
    max-width: 2026px;
    height: 0;
    padding-bottom: 11.6%;
    overflow: hidden;
}

#mainFrameImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#moduleImages {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#moduleImages img {
    position: absolute;
    height: 50.53%;
    width: auto;
    object-fit: contain;
}

/* Configuration section styles */
.config-section {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 5px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1em;
}

select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Module selection grid */
#moduleSelects {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.module-select-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.module-number {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

/* Price summary styles */
.price-summary {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
}

.price-summary p {
    margin: 8px 0;
}

.subtotal {
    font-weight: bold;
}

.total {
    font-size: 20px;
    font-weight: bold;
    margin-top: 15px;
    border-top: 2px solid #ddd;
    padding-top: 15px;
}

.warning-text {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
}

/* Breakdown section styles */
.breakdown {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 6px;
}

.breakdown h3 {
    margin-top: 0;
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
}

.breakdown p {
    margin: 8px 0;
    font-size: 14px;
}

/* Quote form styles */
.quote-form {
    display: none;
    margin: 30px 0;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 800px;
    box-sizing: border-box;
}

.quote-form * {
    box-sizing: border-box;
}

/* Form rows and fields */
.quote-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.quote-form .form-field {
    margin-bottom: 20px;
    width: 100%;
}

.quote-form .form-field.full-width {
    grid-column: 1 / -1;
}

/* Form inputs */
.quote-form input,
.quote-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    margin: 0;
}

.quote-form input::placeholder,
.quote-form textarea::placeholder {
    color: #6c757d;
    font-size: 15px;
}

.quote-form input:focus,
.quote-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

/* Form section styling */
.form-section {
    margin-bottom: 25px;
    width: 100%;
}

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

.form-section-title {
    font-size: 20px;
    color: #2d3748;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
    width: 100%;
}

.form-section-description {
    margin-bottom: 20px;
    color: #4b5563;
    line-height: 1.5;
    font-size: 15px;
}

/* Remove margin from last elements */
.form-section:last-child .form-field:last-child,
.form-section:last-child .form-row:last-of-type {
    margin-bottom: 0;
}

.form-field:last-of-type {
    margin-bottom: 0;
}

/* Text area styles */
.quote-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Button styles */
.primary-button,
.share-config-button,
.load-config-button,
.submit-button,
.quote-request-button {
    background: #3b82f6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.primary-button:hover:not(:disabled),
.share-config-button:hover,
.load-config-button:hover,
.submit-button:hover,
.quote-request-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.primary-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Button group */
.button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.modal p {
    margin-bottom: 20px;
    color: #666;
}

.modal input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 15px;
}

.modal input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

.modal button {
    width: 100%;
    margin-top: 15px;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 300px;
    max-width: 80%;
    animation: fadeInScale 0.3s ease-out;
}

.notification.success {
    border-left: 6px solid #10B981;
}

.notification.error {
    border-left: 6px solid #EF4444;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-icon {
    font-size: 24px;
    color: #10B981;
}

.notification.error .notification-icon {
    color: #EF4444;
}

.notification-message {
    color: #1F2937;
    font-size: 16px;
    font-weight: 500;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #configurator {
        padding: 15px;
    }

    h1 {
        font-size: 20px;
    }

    select {
        padding: 10px;
        font-size: 14px;
    }

    .module-number {
        font-size: 12px;
    }

    #moduleSelects {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quote-form {
        padding: 20px;
    }
    
    .quote-form .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .quote-form input,
    .quote-form textarea {
        padding: 12px 14px;
        font-size: 14px;
    }

    .form-section-title {
        font-size: 18px;
    }

    .button-group {
        flex-direction: column;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 90%;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    #moduleSelects {
        grid-template-columns: 1fr;
    }

    .quote-form {
        padding: 20px;
    }

    .quote-form .form-row {
        gap: 12px;
    }
}