/* styles/components/forms.css */

/* Form labels */
label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
    font-weight: 500;
}

/* Form inputs and selects */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.8rem;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-section-bg);
    color: var(--theme-text);
    border-radius: 4px;
    font-size: 0.95rem;
    max-width: 400px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

/* Number input improvements */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-section-bg);
    color: var(--theme-text);
    border-radius: 4px;
    font-size: 0.95rem;
    max-width: 600px;
    min-height: 100px;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

/* Form section headers */
.content-section h2 {
    font-size: 1.3rem;
    color: var(--theme-accent);
    margin-top: 0;
    margin-bottom: 1rem;
}

.content-section h3 {
    font-size: 1.15rem;
    color: var(--theme-text);
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}

/* Form subsections */
.form-subsection {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--theme-border);
}

.form-subsection:last-of-type {
    border-bottom: none;
}

.form-subsection h3 {
    font-size: 1.1rem;
    color: var(--theme-accent);
    margin-top: 0;
    margin-bottom: 1rem;
}

.form-subsection-description {
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
    margin-bottom: 0.8rem;
    font-style: italic;
}

/* Form actions */
.form-actions {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Pair selection form */
#pair-selection-for-form {
    padding: 0;
    background-color: transparent;
    border: none;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

#pair-selection-for-form label {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0;
    width: auto;
    flex-shrink: 0;
}

#pair-selection-for-form select {
    width: auto;
    min-width: 150px;
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 0;
    flex-grow: 1;
}

#pair-selection-for-form select:disabled {
    background-color: var(--theme-border);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Form status messages */
#pair-settings-save-status,
.status-message {
    margin-left: 1rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}

/* Feedback form specific styles */
#feedback-content .form-subsection {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: none;
}

#feedback-content .form-subsection:last-of-type {
    padding-bottom: 0;
}

#feedback-content #feedback-form-container label {
    display: block;
    margin-bottom: 0.3rem;
}

#feedback-content #feedback-form-container select,
#feedback-content #feedback-form-container input[type="text"],
#feedback-content #feedback-form-container textarea {
    width: 100%;
    max-width: 600px;
    margin-bottom: 1rem;
}

#feedback-content textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-section-bg);
    color: var(--theme-text);
    border-radius: 4px;
    font-size: 0.95rem;
    max-width: 600px;
    min-height: 100px;
    resize: vertical;
}

#feedback-content #feedback-form-container #submit-feedback-btn {
    display: block;
    width: auto;
    min-width: 150px;
    margin-top: 0.5rem;
}

/* Withdraw form */
.withdraw-form-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
    max-width: 440px;
    margin: 12px auto 0 auto;
}

.withdraw-form-modern label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--theme-text);
    margin-bottom: 8px;
    display: block;
}

.address-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.address-input-wrapper:focus-within {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.05);
}

.address-input-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

.address-input-wrapper input {
    flex-grow: 1;
    padding: 16px 50px 16px 16px;
    margin-bottom: 0;
    border: none;
    background: transparent;
    color: var(--theme-text);
    font-size: 0.95rem;
}

.withdraw-form-modern input[type="number"]:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.05);
    outline: none;
}

.withdraw-form-modern input[type="number"] {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--theme-text);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

/* Validation messages */
.validation-message {
    font-size: 0.85rem;
    color: var(--theme-bearish);
    min-height: 1.2em;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-4px);
}

.validation-message:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* Withdraw status */
.withdraw-status {
    margin-top: 16px;
    font-size: 0.95rem;
    text-align: center;
    min-height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.withdraw-status a {
    color: var(--theme-accent);
    text-decoration: none;
    font-weight: 600;
}

.withdraw-status a:hover {
    text-decoration: underline;
}

/* Search form */
.search-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-form-grid > div {
    display: flex;
    flex-direction: column;
}

/* Restore file input */
#restore-file-input {
    margin-bottom: 1rem;
}

/* Delete confirmation input */
#delete-confirmation-input {
    padding: 10px;
    width: 200px;
    text-align: center;
    font-weight: bold;
}

/* Feedback code input */
#feedback-code-input {
    flex-grow: 1;
    margin-bottom: 0;
}

/* Parameter validation */
.param-validation-message {
    display: block;
    font-size: 0.85em;
    color: var(--theme-bearish);
    margin-top: 4px;
    min-height: 1em;
}

.indicator-param-item input[type="number"].invalid-param,
.indicator-param-item input[type="text"].invalid-param {
    border-color: var(--theme-bearish) !important;
}

.indicator-param-item input[type="number"]:focus.invalid-param,
.indicator-param-item input[type="text"]:focus.invalid-param {
    box-shadow: 0 0 0 2px rgba(255, 61, 113, 0.3);
}

/* Parameter recommendations */
.param-recommendation {
    display: block;
    font-size: 0.8em;
    font-style: italic;
    color: var(--theme-text-secondary);
    margin-top: 2px;
    margin-left: 5px;
    min-height: 1em;
}

/* Indicator parameter items */
.indicator-param-item {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.indicator-param-item label {
    font-size: 0.85rem;
    margin-bottom: 0;
    flex-shrink: 0;
    width: 150px;
}

.indicator-param-item input {
    width: 120px;
    max-width: 100%;
    margin-bottom: 0;
}

/* Formatted text containers */
.mp-formatted-text {
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--theme-text);
}

.mp-formatted-text br {
    margin-bottom: 0.5em;
}

.mp-formatted-text p {
    margin-bottom: 1em;
}

.mp-formatted-text ul {
    margin: 0.5em 0;
    padding-left: 20px;
}

.mp-formatted-text li {
    margin-bottom: 0.3em;
}

/* Summary text */
.mp-summary-text {
    background: rgba(74, 144, 226, 0.05);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--theme-accent);
    margin: 10px 0;
    font-size: 1rem;
    line-height: 1.8;
}

/* Story text */
.mp-story-text {
    margin: 10px 0;
    padding: 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Enhanced section headers */
.mp-overall-summary h4,
.mp-stories-list + h4,
.mp-key-metrics h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--theme-border);
    color: var(--theme-text);
}

/* Empty state */
.mp-empty-state {
    text-align: center;
    padding: 30px;
    background: var(--theme-section-bg);
    border-radius: 8px;
    border: 2px dashed var(--theme-border);
    margin: 15px 0;
    color: var(--theme-text-secondary);
    font-style: italic;
}

/* Report footer */
.mp-report-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed var(--theme-border);
    text-align: center;
}

.mp-generated-at {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--theme-text-secondary);
    font-style: italic;
}

.mp-generated-at i {
    color: var(--theme-accent);
}

/* Responsive text formatting */
@media (max-width: 768px) {
    .mp-formatted-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .mp-summary-text {
        padding: 12px 15px;
        font-size: 0.95rem;
        line-height: 1.7;
    }
}

/* Interval selector */
.mp-interval-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mp-interval-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mp-interval-option:hover {
    background-color: var(--theme-section-hover-bg);
    border-color: var(--theme-accent);
}

.market-pulse-subscriptions .mp-interval-option input.mp-subscription-toggle {
    margin: 0;
    margin-right: 8px;
    accent-color: var(--theme-accent);
}

.mp-interval-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--theme-text);
}

.mp-interval-option:has(.mp-subscription-toggle:checked) {
    background-color: rgba(74, 144, 226, 0.15);
    border-color: var(--theme-accent);
}

.mp-interval-option:has(.mp-subscription-toggle:checked) .mp-interval-label {
    color: var(--theme-accent);
}

/* Reporting time info */
.reporting-time-info {
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
    line-height: 1.4;
}

.reporting-time-info small {
    font-style: italic;
}

/* Compact subscription controls */
.mp-compact-subscription-controls {
    margin: 10px 0 15px 0;
    padding: 12px 15px;
    background-color: var(--theme-section-bg);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mp-compact-subscription-controls {
        padding: 12px;
    }

    .mp-interval-selector {
        gap: 8px;
    }

    .mp-interval-option {
        padding: 6px 12px;
    }

    .mp-interval-label {
        font-size: 0.85rem;
    }

    .reporting-time-info {
        font-size: 0.75rem;
    }

    .search-form-grid {
        grid-template-columns: 1fr;
    }
}