/* Enhanced CSS Reset for Customizer to prevent theme conflicts */
.thirava-customizer,
.thirava-customizer *,
.thirava-customizer *:before,
.thirava-customizer *:after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
}

.thirava-customizer {
    display: block !important;
    clear: both !important;
    width: 100% !important;
    max-width: none !important;
    margin: 20px 0 !important;
    padding: 20px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 5px !important;
    background: #fff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 99999 !important;
    text-align: left !important;
    direction: ltr !important;
    font-weight: normal !important;
    font-style: normal !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Enhanced element reset to override theme styles */
.thirava-customizer p,
.thirava-customizer h1,
.thirava-customizer h2,
.thirava-customizer h3,
.thirava-customizer h4,
.thirava-customizer h5,
.thirava-customizer h6 {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    font-weight: normal !important;
    line-height: 1.5 !important;
    color: inherit !important;
    font-family: inherit !important;
    text-shadow: none !important;
    border: none !important;
    background: none !important;
}

.thirava-customizer input,
.thirava-customizer textarea,
.thirava-customizer select,
.thirava-customizer button {
    font-family: inherit !important;
    font-size: inherit !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #333 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    width: auto !important;
    height: auto !important;
    line-height: normal !important;
    vertical-align: baseline !important;
    float: none !important;
    position: static !important;
}

.thirava-customizer button {
    cursor: pointer !important;
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
    vertical-align: middle !important;
    transition: all 0.2s ease !important;
}

.thirava-customizer button:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    color: #fff !important;
    text-decoration: none !important;
}

.customizer-title {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.customizer-field {
    margin-bottom: 15px;
}

.customizer-label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.required {
    color: red;
    margin-left: 5px;
}

.customizer-description {
    font-size: 0.9em;
    color: #666;
    margin-top: -5px;
    margin-bottom: 10px;
}

/* Progress Bar */
#thirava-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.progress-step {
    text-align: center;
    flex-grow: 1;
    color: #aaa;
}

.progress-step .step-number {
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: inline-block;
    margin-bottom: 5px;
    font-weight: bold;
    color: white;
}

.progress-step.active .step-number {
    background-color: #0073aa;
}

.progress-step.completed .step-number {
    background-color: #28a745;
}

.progress-step.active .step-label {
    font-weight: bold;
    color: #0073aa;
}

.progress-step.completed .step-label {
    color: #28a745;
}


/* Step Content */
.customizer-step {
    /* animation for transitions could be added here */
}

.step-title {
    font-size: 1.3em;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Navigation */
.customizer-navigation {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Total Price */
.customizer-total {
    margin-top: 20px;
    text-align: right;
}

.total-price .label {
    font-weight: bold;
}

.total-price .amount {
    font-size: 1.4em;
    font-weight: bold;
    color: #0073aa;
    margin-left: 10px;
}

/* Error Styling */
.customizer-field.has-error .customizer-label {
    color: #d9534f;
}

.customizer-field.has-error input,
.customizer-field.has-error textarea,
.customizer-field.has-error select {
    border-color: #d9534f;
    box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.25);
}

.thirava-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* File Upload Styling */
.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.customizer-file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-upload-label {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.file-upload-label:hover {
    background: #005a87;
    color: white;
}

.upload-icon {
    margin-right: 8px;
}

.file-preview {
    margin-top: 10px;
}

.file-preview img {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.file-info {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Color Picker Styling */
.color-picker-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.customizer-color-picker {
    width: 50px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.color-hex-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.color-presets {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-preset {
    width: 30px;
    height: 30px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: #0073aa;
}

/* Form Input Styling */
.customizer-input,
.customizer-textarea,
.customizer-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.customizer-input:focus,
.customizer-textarea:focus,
.customizer-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
    outline: none;
}

/* Progress bar enhancements */
.progress-step {
    position: relative;
    transition: all 0.3s ease;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-step.completed:not(:last-child)::after {
    background: #28a745;
}

.progress-step .step-number {
    position: relative;
    z-index: 1;
    background: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .thirava-customizer {
        padding: 15px;
    }
    
    #thirava-progress-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .progress-step {
        flex: none;
        min-width: 120px;
    }
    
    .customizer-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .customizer-navigation .button {
        width: 100%;
    }
    
    .color-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
}
