/* Settings Panel Styles */

.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.settings-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.settings-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.settings-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.settings-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.settings-content {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.setting-icon {
    margin-right: 8px;
    font-size: 16px;
}

.setting-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: border-color 0.2s;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Quality Slider */
.quality-slider-container {
    position: relative;
}

.quality-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e1e5e9;
    outline: none;
    -webkit-appearance: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Color Options */
.color-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.color-picker:hover {
    border-color: #667eea;
}

.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Advanced Button */
.advanced-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border: none;
    border-radius: 8px;
    color: #2d3436;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.advanced-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 177, 160, 0.4);
}

/* File Info */
.file-info {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.file-info-text {
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

/* Settings Button (to trigger panel) */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    z-index: 100;
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.settings-btn:active {
    transform: translateY(0);
}

/* Group Settings Styles (Column 2) */
.group-settings {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.group-settings .setting-group {
    margin-bottom: 15px;
}

.group-settings .setting-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    font-size: 13px;
}

.group-settings .setting-icon {
    margin-right: 6px;
    font-size: 14px;
}

.group-settings .setting-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 13px;
    transition: border-color 0.2s;
}

.group-settings .setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Quality Slider for Groups */
.group-settings .quality-slider-container {
    position: relative;
}

.group-settings .quality-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.group-settings .quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.4);
    transition: transform 0.2s;
    border: none;
}

.group-settings .quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.group-settings .quality-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Color Options for Groups */
.group-settings .color-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.group-settings .color-picker {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-left: auto;
}

.group-settings .color-picker:hover {
    border-color: #667eea;
}

.group-settings .color-presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.group-settings .color-preset {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
}

.group-settings .color-preset:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* File Info for Groups */
.group-settings .file-info {
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border-radius: 6px;
    border: none;
}

.group-settings .file-info-text {
    color: #495057;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* Group Settings Container (Column 2) */
.group-settings-container {
    padding: 0;
    margin: 0;
    background: transparent;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* Responsive adjustments for group settings */
@media (max-width: 768px) {
    .group-settings {
        padding: 10px;
    }
    
    .group-settings .color-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .group-settings .color-presets {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Animation for color presets */
.color-preset {
    animation: fadeInUp 0.3s ease forwards;
}

.color-preset:nth-child(1) { animation-delay: 0.1s; }
.color-preset:nth-child(2) { animation-delay: 0.15s; }
.color-preset:nth-child(3) { animation-delay: 0.2s; }
.color-preset:nth-child(4) { animation-delay: 0.25s; }
.color-preset:nth-child(5) { animation-delay: 0.3s; }
.color-preset:nth-child(6) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New Layout Styles */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.setting-row .setting-label {
    margin-bottom: 0;
    flex: 0 0 auto;
}

.setting-row .setting-select {
    flex: 1;
    margin-left: 12px;
    max-width: 200px;
}

.setting-row .color-picker {
    margin-left: 12px;
}

.quality-value {
    font-weight: 600;
    color: #e91e63;
    margin-left: 12px;
    min-width: 40px;
    font-size: 13px;
}

/* Custom Size Inputs */
.custom-size-inputs {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.custom-size-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.custom-size-row:last-child {
    margin-bottom: 0;
}

.custom-label {
    flex: 0 0 90px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.custom-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    margin-right: 6px;
    background: white;
}

.custom-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.unit {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

/* Export Button Styles */
.export-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f8bbd9;
}

.export-section h3 {
    color: #333;
    font-size: 1rem;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-button {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.export-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.export-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.export-icon {
    font-size: 16px;
}

.export-text {
    font-size: 14px;
}
