/* Settings Button Styles */
.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.7);
}

.settings-button svg {
    width: 24px;
    height: 24px;
}

/* Settings Modal Styles */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal.hidden {
    display: none;
}

.settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.settings-panel {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-header h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    margin-bottom: 32px;
}

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

.settings-section h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.settings-row {
    margin-bottom: 16px;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.settings-row label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 8px;
}

.settings-row small {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 4px;
}

.settings-select,
.settings-textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.settings-select:focus,
.settings-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

.settings-select option {
    background: #000;
    color: #fff;
}

.settings-textarea {
    resize: vertical;
    min-height: 100px;
}

.settings-slider {
    width: calc(100% - 60px);
    margin-right: 12px;
}

.settings-slider+span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    min-width: 48px;
    display: inline-block;
}

.settings-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-footer-right {
    display: flex;
    gap: 12px;
}

.settings-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn-primary {
    background: #4CAF50;
    color: #fff;
}

.settings-btn-primary:hover {
    background: #45a049;
}

.settings-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.settings-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Checkbox styles */
input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Preview toggle button */
.preview-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.preview-toggle:hover {
    color: rgba(255, 255, 255, 1);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 12px;
}

.preview-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

/* Default instruction preview */
.default-preview {
    margin-top: 8px;
    margin-bottom: 16px;
}

.default-preview.hidden {
    display: none;
}

.preview-textarea {
    opacity: 0.6;
    cursor: default;
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.preview-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}