/**
 * Form Components
 * Form styling, inputs, toggles, and interactive elements
 */

/* Creator Panel */
.creator-panel {
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    min-height: 0;
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Form Sections */
.section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Section headers - support both old direct h3 and new section-header structure */
/* Higher specificity to override output-panel.css */
.tab-content .section h3,
.tab-content .section .section-header h3 {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Direct h3 styling (legacy) */
.section > h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

/* Section header layout for new structure */
/* Higher specificity to override output-panel.css */
.tab-content .section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px !important;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.tab-content .section .section-header h3 {
    flex: 1;
    margin: 0;
}

/* Preferences button styling moved to buttons.css for consistency */

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Input Fields */
input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: #191970;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

/* Placeholder styling */
input[type="text"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: #191970;
    opacity: 0.7;
}

/* Modern Select Placeholder Styling */
select {
    color: #191970; /* Midnight blue for all select text */
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Hide the placeholder option in dropdown list */
select option[disabled] {
    display: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: rgba(255, 255, 255, 1);
}

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

/* Toggle Buttons */
.toggle-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.toggle-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Toggle button styling moved to buttons.css for consistency */

/* Dropdown Sections */
.dropdown-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Content Rating Toggles */
.content-rating {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.content-toggle,
.optional-toggle {
    padding: 8px 16px;
    border: 2px solid;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-toggle.sfw-mode {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border-color: #059669;
}

.content-toggle.nsfw-mode {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border-color: #d97706;
}

.optional-toggle.hide-optional {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border-color: #9ca3af;
}

.optional-toggle.show-optional {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    border-color: #2563eb;
}

/* NSFW Content Visibility */
.nsfw-content {
    opacity: 0.3;
    pointer-events: none;
    position: relative;
}

.nsfw-content.nsfw-visible {
    opacity: 1;
    pointer-events: auto;
}

.nsfw-content:not(.nsfw-visible)::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 14px;
    color: #666;
    pointer-events: none;
}

.nsfw-group {
    opacity: 0.3;
    pointer-events: none;
    position: relative;
}

.nsfw-group.nsfw-visible {
    opacity: 1;
    pointer-events: auto;
}

.nsfw-group:not(.nsfw-visible)::after {
    content: "🔒";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: #666;
    pointer-events: none;
}

/* Optional Content Visibility */
.optional-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.optional-content.optional-hidden {
    opacity: 0.3;
    pointer-events: none;
}

/* Optional Badge */
.optional-badge {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-left: 1px;
    vertical-align: baseline;
    position: relative;
    top: -2px;
}

/* Optional badge should be dimmed when content is hidden */
.optional-hidden .optional-badge {
    opacity: 0 !important;
}

/* NSFW Badge */
.nsfw-badge {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 1px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    vertical-align: baseline;
    display: inline-block;
    position: relative;
    top: -2px;
}

/* NSFW badge should be dimmed when content is greyed out */
.nsfw-content:not(.nsfw-visible) .nsfw-badge {
    opacity: 0.4;
}

/* Form clear button styling moved to buttons.css for consistency */

/* Form Validation */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.validation-message {
    margin-top: 5px;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
}

.validation-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.validation-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Global Controls Section */
.global-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.global-controls-left {
    display: flex;
    gap: 10px;
}

.global-controls-right {
    display: flex;
    gap: 10px;
}

/* Subcategory Toggle Styles */
.subcategory-toggle {
    padding: 8px 16px;
    border: 2px solid;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.subcategory-toggle.subcategory-on {
    background: linear-gradient(135deg, #2d1b69, #191970);
    color: white;
    border-color: #2d1b69;
    box-shadow: 0 2px 8px rgba(45, 27, 105, 0.3);
}

.subcategory-toggle.subcategory-off {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border-color: #6b7280;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Subcategory toggle hover styling moved to buttons.css */

/* Update Optional Toggle with Dark Purple/Midnight Blue Theme */
.optional-toggle {
    padding: 8px 16px;
    border: 2px solid;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.optional-toggle.hide-optional {
    background: linear-gradient(135deg, #2d1b69, #191970);
    color: white;
    border-color: #2d1b69;
    box-shadow: 0 2px 8px rgba(45, 27, 105, 0.3);
}

.optional-toggle.show-optional {
    background: linear-gradient(135deg, #4a2c7a, #252056);
    color: white;
    border-color: #4a2c7a;
    box-shadow: 0 2px 8px rgba(74, 44, 122, 0.3);
}

/* Optional toggle hover styling moved to buttons.css */

/* Update Content Rating Toggles with Specified Colors */
.content-toggle.sfw-mode {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.content-toggle.nsfw-mode {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Content toggle hover styling moved to buttons.css */

/* Responsive Forms */
@media (max-width: 768px) {
    .toggle-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .dropdown-section {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .content-rating {
        flex-direction: column;
        gap: 8px;
    }
    
    .global-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .global-controls-left,
    .global-controls-right {
        justify-content: center;
    }
}