/* Modern Minimalist Form Design */

/* Hide all form fields initially, show only after recording */
.option-form-fields {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Create a vertical form layout */
.form-section {
    display: none !important;
}

.form-section.active {
    display: block !important;
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin-top: 1rem !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

/* Show labels on top of fields */
.form-group > label {
    display: block !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #495057 !important;
    margin-bottom: 0.5rem !important;
    margin-right: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure gender labels are visible */
label[for="option1-gender-selection"],
label[for="option2-gender-selection"],
label[for="option3-gender-selection"] {
    display: block !important;
    visibility: visible !important;
}

.form-group {
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Remove old radio button styles since we're using dropdowns */
.radio-group-inline {
    display: none !important;
}

.radio-label-inline {
    display: none !important;
}

/* Compact selects */
.form-select {
    padding: 0.4rem 2rem 0.4rem 0.8rem !important;
    font-size: 0.875rem !important;
    border: none !important;
    background-color: #f0f0f0 !important;
    border-radius: 20px !important;
    height: 36px !important;
    min-width: 120px !important;
    cursor: pointer !important;
    display: block !important;
    width: 100% !important;
}

/* Ensure gender select is visible */
#option1-gender-selection,
#option2-gender-selection,
#option3-gender-selection {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

/* Ensure the gender form group is visible */
.form-section .form-group:first-child,
.form-section .form-group:nth-child(2) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force gender dropdown container to show */
.form-group:has(select[name*="gender"]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 1rem !important;
}

/* Info button styled as link */
.info-button {
    padding: 0 0.25rem !important;
    font-size: 0.8rem !important;
    background: transparent !important;
    color: #2a69ac !important;
    border: none !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    display: inline !important;
    font-weight: normal !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    transition: all 0.2s !important;
    margin-left: 0.25rem !important;
}

/* Add info icon before text */
.info-button::before {
    content: "ⓘ " !important;
    font-size: 0.9rem !important;
    margin-right: 0.2rem !important;
}

.info-button:hover {
    color: #1e4d8a !important;
    text-decoration: none !important;
}

.info-button:focus {
    outline: 2px solid #2a69ac !important;
    outline-offset: 2px !important;
}

/* Style label with info button */
.label-with-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.label-with-info label {
    margin-bottom: 0 !important;
}

/* Compact email */
input[type="email"] {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.875rem !important;
    border: none !important;
    background-color: #f0f0f0 !important;
    border-radius: 20px !important;
    height: 36px !important;
    min-width: 200px !important;
}

/* Hide email info note */
.email-info-note {
    display: none !important;
}

/* Submit button with padding */
.form-section button[type="submit"] {
    margin: 1.5rem 0 0 0 !important;
    padding: 0.75rem 2rem !important;
    font-size: 1rem !important;
    background: #2a69ac !important;
    color: white !important;
    border: none !important;
    border-radius: 24px !important;
    height: auto !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    white-space: nowrap !important;
    width: 100% !important;
    max-width: 200px !important;
    cursor: pointer !important;
}

.form-section button[type="submit"]:hover {
    background: #1e4d8a !important;
    transform: scale(1.05) !important;
}

.form-section button[type="submit"]::before {
    content: "→" !important;
    font-size: 1.2rem !important;
}

/* Alternative: Stepper form design */
.form-stepper {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 1rem 2rem;
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.form-stepper.active {
    display: block;
}

.stepper-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-indicator {
    display: flex;
    gap: 0.25rem;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s;
}

.step-dot.active {
    background: #2a69ac;
    width: 24px;
    border-radius: 4px;
}

/* Floating labels alternative */
.floating-form {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 1rem;
}

.floating-field {
    position: relative;
    margin-bottom: 1rem;
}

.floating-field input,
.floating-field select {
    width: 100%;
    padding: 1rem 0.5rem 0.5rem;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    background: transparent;
    font-size: 1rem;
    transition: all 0.3s;
}

.floating-field label {
    position: absolute;
    top: 1rem;
    left: 0.5rem;
    font-size: 1rem;
    color: #999;
    pointer-events: none;
    transition: all 0.3s;
}

.floating-field input:focus,
.floating-field input:not(:placeholder-shown),
.floating-field select:focus,
.floating-field select:valid {
    border-bottom-color: #2a69ac;
}

.floating-field input:focus ~ label,
.floating-field input:not(:placeholder-shown) ~ label,
.floating-field select:focus ~ label,
.floating-field select:valid ~ label {
    top: 0;
    font-size: 0.75rem;
    color: #2a69ac;
}

/* Quick form - everything in one row */
.quick-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 30px;
    margin-top: 1rem;
}

.quick-form .form-group {
    flex: 1;
}

.quick-form input,
.quick-form select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: none;
    background: white;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Mobile optimized */
@media (max-width: 768px) {
    /* Larger option cards on mobile */
    .option-card {
        border-width: 2px !important;
        border-radius: 20px !important;
        margin-bottom: 1.5rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    }
    
    .option-header {
        padding: 1.5rem 1.25rem !important;
        min-height: 70px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .option-header h4 {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
    }
    
    .option-content {
        padding: 1.5rem 1.25rem !important;
        display: none !important;
    }
    
    .option-content.expanded {
        display: block !important;
    }
    
    /* Make touch targets larger */
    .option-header::after {
        content: "▼" !important;
        position: absolute !important;
        right: 1.25rem !important;
        color: white !important;
        font-size: 0.8rem !important;
        transition: transform 0.2s !important;
    }
    
    .option-card.expanded .option-header::after {
        transform: rotate(180deg) !important;
    }
    
    /* Larger buttons on mobile */
    .audio-controls button {
        padding: 0.75rem 1.25rem !important;
        font-size: 1rem !important;
        min-height: 48px !important;
        min-width: 120px !important;
    }
    
    /* Form adjustments */
    .form-section.active {
        display: block !important;
        border-radius: 16px !important;
        padding: 1.25rem !important;
    }
    
    .form-group {
        width: 100% !important;
        margin-bottom: 1.25rem !important;
    }
    
    .radio-group-inline {
        justify-content: center !important;
        margin-bottom: 0.5rem !important;
    }
    
    .form-select,
    input[type="email"] {
        width: 100% !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 48px !important;
    }
    
    .form-section button[type="submit"] {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        min-height: 48px !important;
        font-size: 1rem !important;
        margin: 1.5rem 0 0 0 !important;
        padding: 0.85rem 2rem !important;
    }
    
    /* Larger sentence display */
    .selected-sentence {
        font-size: 1.05rem !important;
        line-height: 1.6 !important;
        padding: 1rem !important;
    }
}

/* Progressive disclosure */
.form-step {
    display: none;
    animation: slideIn 0.3s ease;
}

.form-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip for required fields */
.required-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

/* Success animation */
@keyframes success {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.form-success {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    animation: success 0.5s ease;
}

.form-success.active {
    display: block;
}

/* ABSOLUTE OVERRIDE - Gender field must be visible */
.form-section.active .form-group:nth-child(2) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Gender select and label absolute visibility */
.form-section.active label[data-i18n="contribute.form.gender"],
.form-section.active select[name*="gender"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Remove all decorative elements */
.option-form-fields::before,
.form-group::before,
.form-group::after {
    display: none !important;
}

/* Larger option cards for better usability */
.option-card {
    border: 2px solid #e0e0e0 !important;
    border-radius: 16px !important;
    margin-bottom: 1rem !important;
    overflow: hidden !important;
    transition: all 0.2s !important;
    background: #0066cc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.option-card:hover {
    border-color: #2a69ac !important;
    box-shadow: 0 6px 20px rgba(42, 105, 172, 0.15) !important;
    transform: translateY(-2px) !important;
}

.option-header {
    background: transparent !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    position: relative !important;
}

.option-header h4 {
    color: white !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.option-content {
    padding: 1.25rem 1.5rem !important;
    background: #fafafa !important;
    display: none !important;
}

.option-content.expanded {
    display: block !important;
}

/* Sentence display minimal */
.selected-sentence-container {
    margin: 0.5rem 0 !important;
    padding: 0.75rem !important;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
}

.selected-sentence {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
}

.recording-instruction {
    display: none !important;
}

/* Audio controls inline */
.audio-controls {
    display: flex !important;
    gap: 0.5rem !important;
    margin: 0.5rem 0 !important;
}

.audio-controls button {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
}

/* Hide headers */
.form-section h4 {
    display: none !important;
}

/* Debug: Make sure gender form group is absolutely visible */
.form-section .form-group:has(label[for*="gender-selection"]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Debug: Gender select specific styling */
select[id*="gender-selection"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}