/* ==========================================
   TOPBAR BUTTONS (Create & Settings)
   ========================================== */

.iai-topbar-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    height: 36px;
    margin-left: 12px;
    margin-top: 7px;
}

/* Create Button */
.iai-topbar-create-btn {
    display: flex;
    align-items: center;
    padding: 4px 16px;
    background: #F0EDE8;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.iai-topbar-create-btn:hover {
    background: #ebebeb;
    border-color: #d0d0d0;
}

.iai-topbar-create-btn span:first-child {
    font-weight: 500;
    font-size: 12px;
    color: #343230;
}

.iai-topbar-create-btn svg {
    width: 16px;
    height: 16px;
    margin: 0 2px 4px 10px;
    stroke: #343230;
    stroke-width: 2;
    transform: rotate(-35deg);
}

.iai-create-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.iai-create-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #343230;
}

/* Settings Button */
.iai-topbar-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iai-topbar-settings-btn:hover {
    background: transparent;
    border: none;
}

.iai-topbar-settings-btn.active {
    background: #343230;
    border-color: #343230;
}

.iai-topbar-settings-btn.active svg {
    stroke: white;
}

.iai-topbar-settings-btn svg {
    width: 21px;
    height: 21px;
    stroke: #343230;
    transform: rotate(90deg);
    stroke-width: 2;
}

/* ==========================================
   SETTINGS PANEL
   ========================================== */

.iai-settings-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: auto;
    padding-right: 12%;
    border-radius: 12px;
    z-index: 9998;
    transition: top 0.2s ease;
    will-change: top;
    padding: 0px calc(12% + 35px) 0 0px;
}

.iai-settings-panel-wrapper {
    border: 1px solid #E5E1DA;
    border-radius: 9px;
    padding: 10px calc(0% + 10px) 10px 20px;
    background: #fff;
    display: flex;
    align-items: center;
}

.iai-settings-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #343230;
}

.iai-settings-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Setting Groups 
.iai-setting-group {
    margin-bottom: 16px;
}*/

/*.iai-setting-group:last-child {
    margin-bottom: 0;
}*/

.iai-setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    border-radius: 3px;
    width: auto;
    height: 32px;
}

.iai-setting-label svg {
    width: 18px;
    height: 18px;
    stroke: #666;
    stroke-width: 2;
    flex-shrink: 0;
}

.iai-setting-label span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Style pour les selects */
.iai-setting-select {
    flex: 1;
    padding: 6px 12px;
    background: #F0EDE8;
    border: 1px solid #E5E1DA;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #343230;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-align-last: center; /* IMPORTANT */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;    
    appearance: none;      
    background-image: none;
}

.iai-setting-select option {
  text-align: center!important;
}

.iai-setting-select::-ms-expand {
  display: none;
}

.iai-setting-select:hover {
    background: #E8E4DD;
    border-color: #D5D0C5;
}

.iai-setting-select:focus {
    border-color: #343230;
    box-shadow: 0 0 0 2px rgba(52, 50, 48, 0.1);
}

/* ==========================================
   CUSTOM SELECT (Aspect Ratio)
   ========================================== */

.iai-custom-select {
    position: relative;
    width: 100%;
    user-select: none;
}

.iai-custom-select-selected {
    padding: 6px 8px;
    gap: 6px;
    background: #F0EDE8;
    border: 1px solid #E5E1DA;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    width: 68px;
    color: #343230;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iai-custom-select-selected:hover {
    background: #E8E4DD;
    border-color: #D5D0C5;
}

.iai-custom-select.active .iai-custom-select-selected {
    border-color: #343230;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.iai-custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #F0EDE8;
    border: 1px solid #343230;
    border-top: none;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.iai-custom-select.active .iai-custom-select-options {
    display: block;
}

.iai-custom-select-options li {
    padding: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #343230;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.iai-custom-select-options li:hover {
    background: #E8E4DD;
}

.iai-custom-select-options li.selected {
    background: #E8E4DD;
}

.iai-custom-select-options li.selected:hover {
    background: #E8E4DD;
}

/* Slider Group 
.iai-slider-group {
    margin-top: 20px;
}*/

.iai-slider-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    background: #F0EDE8;
    border: 1px solid #E5E1DA;
    border-radius: 3px;
    width: fit-content;
    height: 32px;
}

.iai-slider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: white;
    border: 1px solid #E5E1DA;
    border-radius: 2px;
    font-size: 16px;
    font-weight: 600;
    color: #343230;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.iai-slider-btn:hover {
    background: #E8E4DD;
    border-color: #D5D0C5;
}

.iai-slider-btn:active {
    transform: scale(0.95);
}

.iai-slider-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.iai-slider-value {
    font-size: 13px;
    font-weight: 600;
    color: #343230;
    min-width: 20px;
    text-align: center;
}

/* Image Count Control */
.iai-image-count-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 8px;
    background: #F0EDE8;
    border: 1px solid #E5E1DA;
    border-radius: 3px;
    width: 76px;
    height: 30px;
}

.iai-count-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 2px;
    font-size: 16px;
    font-weight: 600;
    color: #343230;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    padding: 0;
}

.iai-count-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    color: #343230;
}

.iai-count-btn:hover {
    background: #E8E4DD;
    border-radius: 3px;
}

.iai-count-btn:active {
    transform: scale(0.95);
}

.iai-count-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.iai-count-value {
    font-size: 12px;
    font-weight: 500;
    color: #343230;
    min-width: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .iai-topbar-buttons {
        gap: 6px;
        margin-left: 8px;
    }
    
    .iai-topbar-create-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .iai-topbar-settings-btn {
        width: 36px;
        height: 36px;
    }
    
    .iai-settings-panel {
        width: 260px;
    }
}
