/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 1.5rem;
}

footer {
    margin-top: auto;
}

.app-container {
    margin-bottom: 2rem;
    flex: 1;
}

/* Form elements */
.input-style {
    border: 2px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.625rem;
    color: #4a5568;
    background-color: #fff;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-style:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

textarea.input-style {
    resize: vertical;
    min-height: 80px;
}

/* Compact select style */
.compact-select {
    border: 2px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: #4a5568;
    background-color: #fff;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.875rem;
    appearance: menulist;
}

.compact-select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* Button styles */
.button-style {
    background-color: #4299e1;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button-style:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button-style:active {
    transform: translateY(0);
}

.button-style:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.4);
}

.button-style:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

/* Secondary button style */
.button-style-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.button-style-secondary:hover {
    background-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button-style-secondary:active {
    transform: translateY(0);
}

.button-style-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(203, 213, 224, 0.4);
}

/* Button icons */
button svg {
    transition: transform 0.2s ease;
}

button:hover svg {
    transform: scale(1.1);
}

/* Layout components */
.control-panel, .image-display {
    transition: all 0.3s ease;
}

/* Control panel max height */
.control-panel > div {
    max-height: 600px;
    overflow-y: auto;
}

/* Make sure the advanced settings panel doesn't cause excessive height */
#advancedSettingsPanel {
    max-height: 200px;
    overflow-y: auto;
}

/* Image display */
.image-display {
    background-color: #f8f9fa;
}

.image-display > div {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

.image-item {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

#image img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    object-fit: cover;
    aspect-ratio: 1/1;
}

#placeholder {
    color: #a0aec0;
    padding: 2rem;
}

#placeholder svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

#image img:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .control-panel, .image-display {
        width: 100%;
    }
}

/* Advanced Settings Styles */
#advancedSettingsToggle {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

#advancedSettingsToggle:hover {
    color: #4299e1;
}

#advancedSettingsToggle.active {
    background-color: #edf2f7;
    border-bottom: 2px solid #2d3748;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #2c5282;
    font-weight: 500;
}

#advancedSettingsToggle svg {
    transition: transform 0.3s ease;
}

#advancedSettingsPanel {
    background-color: #f8fafc;
    border-radius: 0.375rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

/* Toggle Switch Styles */
input[type="checkbox"].sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Example Prompts Styles */
/* Example Prompts heading style */
#examplePromptsToggle {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

#examplePromptsToggle:hover {
    color: #4299e1;
}

#examplePromptsToggle.active {
    background-color: #edf2f7;
    border-bottom: 2px solid #2d3748;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: #2c5282;
    font-weight: 500;
}

#examplePromptsToggle svg {
    transition: transform 0.3s ease;
}

.example-prompts-container {
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    background-color: #f8fafc;
}

.example-prompt {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 8px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 8px;
    position: relative;
}

.example-prompt:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.example-prompt:before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-color: transparent transparent transparent transparent;
    transition: all 0.2s ease;
}

.example-prompt:hover {
    border-left-color: #4299e1;
    transform: translateX(2px);
    background-color: #f0f7ff;
}

.example-prompt:hover:before {
    border-color: transparent transparent transparent #4299e1;
    left: -5px;
}

.example-prompt.selected {
    background-color: #ebf8ff;
    border-left-color: #4299e1;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.example-prompt.selected:before {
    border-color: transparent transparent transparent #4299e1;
    left: -5px;
}

/* Add numbering to prompts for better reference */
.example-prompts-container ul {
    counter-reset: prompt-counter;
}

.example-prompt {
    counter-increment: prompt-counter;
    padding-left: 25px;
    position: relative;
}

.example-prompt:after {
    content: counter(prompt-counter);
    position: absolute;
    left: 8px;
    top: 8px;
    font-size: 10px;
    font-weight: bold;
    color: #718096;
    background: #e2e8f0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base instructions styles */
.base-instructions-enabled {
    transition: all 0.3s ease;
}

.toggle-label-enabled {
    color: #48bb78 !important; /* Green text */
    font-weight: 600;
}

.toggle-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.toggle-indicator-on {
    background-color: #48bb78; /* Green dot */
}

.toggle-indicator-off {
    background-color: #4a5568; /* Darker gray dot */
}