/* Modified CSS to avoid conflicts with Font Awesome */
:root {
    --primary: #1ba4c8;
    --primary-dark: #1892B2;
    --secondary: #1892B2;
    --light-bg: #F8FCFF;
    --border: #e1e5f1;
    --text: #333;
    --text-light: #666;
    --danger: #ff6b6b;
    --success: #06d6a0;
    --warning: #ffd166;
}


button.primary { text-transform: none; }
.flex { flex: 1; }


/*.btn-inverse {
    background-color: rgba(215, 218, 219, 0.75) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
}*/
/*.btn-inverse:hover:not(:disabled) {
    background-color: rgba(27, 164, 200, 0.2) !important;
}*/
.btn-inverse:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: rgba(27, 164, 200, 0.2) !important;
    color: var(--primary) !important;
}



.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
}

.container-custom p { text-align: center; line-height: 10px; }
.container-custom select { margin-bottom: 0; }
.container-custom h3, 
.container-custom h3 a { font-size: 18px !important; padding: 0px; }

.content-wrapper-custom {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.left-panel-custom {
    flex: 0 0 385px;
    padding: 15px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-panel-custom {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-custom {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    position: relative;
}

.section-title-custom {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-custom .fa-icon {
    color: var(--primary);
}

/* Upload Area */
.upload-area-custom {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    background-color: rgba(75, 108, 183, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.upload-area-custom:hover {
    background-color: rgba(75, 108, 183, 0.08);
    border-color: var(--primary-dark);
}

.upload-area-custom .fa-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.upload-area-custom h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--secondary);
}

.upload-area-custom p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-align: center;
}

.upload-btn-custom {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.upload-btn-custom:hover {
    background-color: var(--primary-dark);
}

#fileInput {
    display: none;
}

/* Form Controls */
.form-group-custom {
    margin-bottom: 12px;
}

.form-group-custom label {
    display: block;
    margin-bottom: 2px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}
/* In the .form-group-custom section, add this: */
.form-group-custom:has(.radio-groups-container-custom) {
    margin-bottom: 12px;
}

.dimensions-input-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dimensions-input-custom input {
    width: 70px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.dimensions-input-custom .separator-custom {
    font-weight: 600;
    color: var(--text-light);
}

.units-select-custom {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    width: 75px;
}

.select-full-custom {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

/* Radio Groups - Updated for single line */
.radio-group-custom {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    flex: 1;
    justify-content: center;
}

.radio-group-custom input {
    margin-right: 6px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.radio-group-custom label {
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.radio-groups-container-custom {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(27, 164, 200, 0.2);
    border-radius: 6px;
    margin-bottom: 12px;
}

/* Make entire button clickable, hide radio button */
.radio-groups-container-custom .radio-group-custom {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.radio-groups-container-custom .radio-group-custom input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 2; /* Make sure it's on top for clicking */
}

.radio-groups-container-custom .radio-group-custom label {
    position: relative;
    z-index: 1; /* Make sure label is above for text selection */
    pointer-events: none; /* Let clicks pass through to the input */
}

.radio-groups-container-custom .radio-group-custom:hover {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.05);
}

.radio-groups-container-custom .radio-group-custom:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.1);
}

.radio-groups-container-custom .radio-group-custom:has(input[type="radio"]:checked) label {
    color: var(--primary);
    font-weight: 600;
}

.radio-groups-container-custom input[type="radio"]:checked + label {
    color: var(--primary);
    font-weight: 600;
}

.radio-groups-container-custom input[type="radio"]:checked ~ .radio-group-custom {
    border-color: var(--primary);
    background: rgba(27, 164, 200, 0.1);
}

/* Hide the actual radio buttons but keep them functional */
.radio-groups-container-custom input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-groups-container-custom input[type="radio"]:focus + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Color Options */
.color-options-custom {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.color-option-custom {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.color-option-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #aaa;
}

.color-option-custom.active-custom {
    border-color: #4b6cb7;
    box-shadow: 0 0 0 2px rgba(75, 108, 183, 0.2);
}

.color-preview-custom {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* Color Picker */
.color-picker-wrapper-custom {
    position: relative;
}

#colorPicker {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Quality Slider */
.quality-slider-container-custom {
    margin-top: 8px;
}

.quality-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.quality-value-custom {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.quality-description-custom {
    font-size: 0.8rem;
    color: var(--text-light);
}

.quality-slider-custom {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--slider-percent, 85%), #e0e0e0 var(--slider-percent, 85%), #e0e0e0 100%);
    outline: none;
    border-radius: 2.5px;
}

.quality-slider-custom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Action Buttons */
.action-buttons-custom {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}



/* Preview Area */
.preview-area-custom {
    flex: 1;
    min-height: 300px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.preview-container-custom {
    width: 100%;
    height: 100%;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#previewImage {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: none;
}

.preview-placeholder-custom {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.preview-placeholder-custom .fa-icon {
    font-size: 3rem;
    color: #d1d9f0;
    margin-bottom: 10px;
}

/* Combined Info Container */
.combined-info-container-custom {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    background: rgb(31 31 32 / 49%);
    color: white;
    padding: 2px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(2px);
/*    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;*/
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    height: 70px;
    margin: 0;
    pointer-events: none;
}

.combined-info-container-custom * {
    pointer-events: auto;
}

.info-left-custom {
    flex: 0 0 auto;
}

.info-right-custom {
    flex: 1;
    margin-left: 20px;
    min-width: 0;
    text-align: right;
}

.dimension-values-custom {
    display: flex;
    gap: 15px;
}

.dimension-item-custom {
    text-align: center;
    min-width: 60px;
}

.dimension-row-custom {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dimension-row-custom .value-custom {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dimension-row-custom .label-custom {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.info-text-custom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-line-custom {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

.combined-info-container-custom::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    /*background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4));*/
    pointer-events: none;
}

/* File List */
.file-list-container-custom {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.file-list-custom {
    flex: 1;
    overflow-y: auto;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
}

.file-list-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.file-list-header-custom h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
}

.file-count-custom {
    font-size: 0.8rem;
    color: var(--text-light);
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.file-item-custom {
    display: flex;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s;
    cursor: pointer;
}

.file-item-custom:last-child {
    border-bottom: none;
}

.file-item-custom:hover {
    background-color: rgba(255,255,255,0.7);
}

.file-item-custom.active-custom {
    background-color: rgba(75, 108, 183, 0.1);
    border-left: 3px solid var(--primary);
}

.file-preview-custom {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 8px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-preview-custom img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-preview-custom .fa-icon {
    color: #d1d9f0;
    font-size: 1.1rem;
}

.file-details-custom {
    flex: 1;
    min-width: 0;
}

.file-name-custom {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size-custom {
    font-size: 0.75rem;
    color: var(--text-light);
}

.file-remove-custom {
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    opacity: 0;
}

.file-item-custom:hover .file-remove-custom {
    opacity: 1;
}

.file-remove-custom:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

/* Loading */
.loading-custom {
    display: none;
    text-align: center;
    padding: 8px;
}

.spinner-custom {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state-custom {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.empty-state-custom .fa-icon {
    font-size: 2rem;
    color: #d1d9f0;
    margin-bottom: 8px;
}

/* Gradient Picker Modal */
.gradient-picker-modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gradient-picker-content-custom {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.gradient-preview-custom {
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: #f8f9fa;
}

.gradient-preview-custom canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.gradient-controls-custom {
    margin-bottom: 20px;
}

.gradient-control-group-custom {
    margin-bottom: 15px;
}

.gradient-control-group-custom:last-child {
    margin-bottom: 0;
}

.gradient-control-group-custom label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.gradient-control-group-custom select,
.gradient-control-group-custom input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.gradient-control-group-custom input[type="range"] {
    -webkit-appearance: none;
    height: 5px;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, #e0e0e0 50%, #e0e0e0 100%);
    border-radius: 2.5px;
    border: none;
    padding: 0;
}

.gradient-control-group-custom input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#gradientAngle[type="range"] {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, #e0e0e0 50%, #e0e0e0 100%);
    outline: none;
    border-radius: 2.5px;
    border: none;
    padding: 0;
}

#gradientAngle[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Color Stop Sliders */
.color-stops-container-custom {
    margin-bottom: 15px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
}

.color-stop-item-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--light-bg);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.color-stop-input-custom {
    width: 36px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: transparent;
    flex-shrink: 0;
}

.color-stop-slider-container-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.color-stop-position-custom {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.color-stop-position-custom[type="range"] {
    -webkit-appearance: none;
    height: 5px;
    border-radius: 2.5px;
    border: none;
    padding: 0;
    margin: 0;
}

.color-stop-percent-custom {
    min-width: 36px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    flex-shrink: 0;
}

.remove-color-stop-custom {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-color-stop-custom:hover {
    background: #ff5252;
}

.modal-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.modal-header-custom h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin: 0;
    font-weight: 600;
}

.modal-close-custom {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close-custom:hover {
    background: #f5f5f5;
}

.modal-actions-custom {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

#applyGradient {
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

#applyGradient:hover {
    background: var(--primary-dark);
}

#addColorStop {
    padding: 6px 12px;
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

#addColorStop:hover {
    background: var(--primary);
    color: white;
    text-shadow: none;
}

#addColorStop i {
    font-size: 12px;
}

/* Scrollbar */
.color-stops-container-custom::-webkit-scrollbar {
    width: 5px;
}

.color-stops-container-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.color-stops-container-custom::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.color-stops-container-custom::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper-custom {
        flex-direction: column;
    }
    
    .left-panel-custom {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 50vh;
    }
    
    .right-panel-custom {
        flex: 1;
    }
    
    .container-custom {
        height: auto;
        max-height: calc(100vh - 30px);
    }
    
    .combined-info-container-custom {
        height: 60px;
        padding: 10px;
    }
    
    .dimension-values-custom {
        gap: 10px;
    }
    
    .dimension-item-custom {
        min-width: 50px;
    }
    
    .dimension-row-custom .value-custom {
        font-size: 14px;
    }
    
    .info-line-custom {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .dimensions-input-custom input {
        width: 60px;
    }
    
    .units-select-custom {
        width: 65px;
    }
    
    .btn-custom {
        font-size: 0.85rem;
        padding: 8px 3px;
    }
    
    .gradient-picker-content-custom {
        padding: 15px;
        max-height: 85vh;
    }
    
    .color-stop-item-custom {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .combined-info-container-custom {
        height: 55px;
        padding: 8px 10px;
    }
    
    .dimension-values-custom {
        gap: 8px;
    }
    
    .dimension-item-custom {
        min-width: 45px;
    }
    
    .dimension-row-custom .value-custom {
        font-size: 13px;
    }
    
    .dimension-row-custom .label-custom {
        font-size: 10px;
    }
    
    .info-text-custom {
        gap: 2px;
    }
    
    .info-line-custom {
        font-size: 10px;
    }
}