/* styles/pages/trade-settings.css */

/* Trade Settings Section */
.content-section > section {
    margin-bottom: 2rem;
}

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

/* Section Header Bar */
.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--theme-border);
}

.section-header-bar h2 {
    margin: 0;
    color: var(--theme-accent);
    font-size: 1.4rem;
}

.section-header-bar .report-actions,
.section-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.section-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.section-actions button i.fa-spin {
    animation: fa-spin 1s linear infinite;
}

/* Trade Pairs List Section */
#trade-pairs-list-section {
    /* Styles already defined in section-header-bar */
}

#configured-pairs-list .pair-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: var(--theme-section-bg);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

#configured-pairs-list .pair-list-item span {
    font-weight: 500;
}

#configured-pairs-list .pair-actions button {
    margin-left: 0.5rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

/* Pair Details Form Section */
#pair-details-form-section {
    /* Display controlled by JS */
}

#pair-details-form-title {
    /* Inherits from h2 */
}

/* Pair Selection */
#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 Subsection */
.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;
}

/* AI Model Select */
#ai-model-select {
    max-width: 400px;
    margin-bottom: 1rem;
}

/* Tier Descriptions */
.tier-descriptions-section {
    margin-top: 20px;
}

.tier-descriptions-section h4 {
    font-size: 1.05rem;
    color: var(--theme-text);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.tier-description {
    display: none;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--theme-border);
    border-left-width: 3px;
    border-radius: 4px;
    background-color: rgba(0,0,0,0.05);
    line-height: 1.5;
}

.tier-description h5 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1em;
    color: var(--theme-accent);
}

.tier-description p {
    font-size: 0.9em;
    color: var(--theme-text-secondary);
    margin-bottom: 0;
}

#premium-desc {
    border-left-color: var(--theme-accent);
}

#standard-desc {
    border-left-color: #5cb85c;
}

#basic-desc {
    border-left-color: #f0ad4e;
}

#budget-desc {
    border-left-color: #777;
}

/* Analysis Path Selection */
.analysis-path-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.path-card {
    border: 2px solid var(--theme-border);
    border-radius: 8px;
    padding: 1.5rem;
    background-color: var(--theme-section-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.path-card:hover {
    border-color: var(--theme-accent);
    background-color: var(--theme-section-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.path-card.selected {
    border-color: var(--theme-accent);
    background-color: rgba(74, 144, 226, 0.1);
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.path-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.path-card-header i {
    font-size: 1.5rem;
    color: var(--theme-accent);
}

.path-card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--theme-text);
    flex-grow: 1;
}

.recommended-badge {
    background-color: var(--theme-bullish);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advanced-badge {
    background-color: var(--theme-neutral);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.path-description {
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.path-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.path-benefits li {
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
}

.path-benefits li::before {
    content: '✓';
    color: var(--theme-bullish);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Path Configuration */
.path-configuration {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(74, 144, 226, 0.05);
    border: 1px solid var(--theme-accent);
    border-radius: 6px;
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.2s ease;
}

.path-configuration:empty {
    display: none !important;
}

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

.path-configuration h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--theme-accent);
    font-size: 1.1rem;
}

.config-description {
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Strategy Select */
#strategy-select {
    margin-bottom: 1rem;
    max-width: 400px;
}

/* Strategy Focus Box */
.strategy-focus-box {
    background-color: rgba(74, 144, 226, 0.07);
    border: 1px solid var(--theme-accent);
    border-left-width: 4px;
    padding: 1.2rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.strategy-focus-title {
    font-size: 1.25rem;
    color: var(--theme-accent);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.strategy-focus-description {
    font-size: 0.95rem;
    color: var(--theme-text);
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.strategy-focus-box h5 {
    font-size: 1rem;
    color: var(--theme-text);
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.strategy-included-indicators-list {
    display: grid;
    gap: 1rem;
}

.strategy-indicator-item {
    background-color: var(--theme-section-bg);
    padding: 0.8rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--theme-border);
}

.strategy-indicator-name {
    display: block;
    font-weight: 600;
    color: var(--theme-text);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.strategy-indicator-description {
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Shared Params Container */
.shared-params-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(74, 144, 226, 0.03);
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    animation: slideIn 0.3s ease-out;
}

.shared-params-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--theme-text);
    font-size: 1.1rem;
}

/* Indicator Selection */
#indicator-selection {
    margin-bottom: 1rem;
}

.indicator-category-header {
    font-size: 1.05rem;
    color: var(--theme-accent);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--theme-border);
    font-weight: 500;
}

#indicator-selection > .indicator-category-header:first-of-type {
    margin-top: 0;
}

.indicator-category-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

#indicator-selection label,
#strategy-selection label {
    display: flex;
    align-items: center;
    background-color: var(--theme-section-bg);
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--theme-border);
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

#indicator-selection label:hover,
#strategy-selection label:hover {
    background-color: var(--theme-section-hover-bg);
}

#indicator-selection input[type="checkbox"],
#strategy-selection input[type="checkbox"] {
    margin-right: 0.5rem;
    flex-shrink: 0;
    accent-color: var(--theme-accent);
}

.indicator-label {
    display: flex;
    align-items: center;
    background-color: var(--theme-section-bg);
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--theme-border);
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    font-size: 0.9rem;
}

.indicator-label:hover {
    background-color: var(--theme-section-hover-bg);
}

.indicator-label.disabled-indicator {
    opacity: 0.6;
    background-color: var(--theme-border);
    cursor: not-allowed;
}

.indicator-label.disabled-indicator:hover {
    background-color: var(--theme-border);
}

.indicator-label input[type="checkbox"] {
    margin-right: 0.5rem;
    flex-shrink: 0;
    accent-color: var(--theme-accent);
}

.indicator-label.disabled-indicator input[type="checkbox"] {
    cursor: not-allowed;
}

/* Indicator Parameters */
.indicator-params {
    border-left: 3px solid var(--theme-accent);
    padding: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    background-color: rgba(74, 144, 226, 0.05);
    border-radius: 0 4px 4px 0;
}

.indicator-params h4 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: var(--theme-text);
}

.indicator-params .indicator-description {
    font-size: 0.88rem;
    color: var(--theme-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
    font-style: italic;
}

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

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

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

.indicator-params div {
    margin-bottom: 0.5rem;
}

.indicator-params label {
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

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

/* Param UI Hint */
.param-ui-hint {
    font-size: 0.85em;
    color: var(--theme-text-secondary);
    margin-left: 8px;
    font-style: italic;
}

/* Param Validation Message */
.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);
}

/* Param Recommendation */
.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-param-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.indicator-param-item .param-recommendation {
    margin-left: 8px;
    margin-top: 0;
    flex-basis: auto;
}

/* Notification Options */
.notification-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.notification-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.notification-options input[type="checkbox"] {
    margin-right: 0.4rem;
    accent-color: var(--theme-accent);
}

.notification-details {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.notification-details input[type="text"] {
    max-width: 350px;
}

/* Estimated Cost Section */
#estimated-cost-section {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background-color: rgba(74, 144, 226, 0.05);
    border: 1px solid var(--theme-border);
    border-left: 3px solid var(--theme-accent);
    border-radius: 4px;
}

#estimated-cost-section h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: var(--theme-accent);
}

#estimated-cost-section p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--theme-text-secondary);
}

#estimated-cost-section p strong {
    color: var(--theme-text);
    font-weight: 600;
}

#estimated-cost-section .total-price-display {
    font-size: 1.1rem;
    margin-top: 0.8rem;
}

#total-estimated-price-usd-display,
#total-estimated-price-sol-display {
    font-weight: 700;
    color: var(--theme-bullish);
}

#estimated-cost-section p small {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.85em;
    color: var(--theme-text-secondary);
    line-height: 1.4;
}

#refresh-sol-price-btn {
    background-color: transparent;
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
    padding: 3px 8px;
    font-size: 0.85em;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 4px;
    cursor: pointer;
}

#estimated-cost-section .price-note small {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.85em;
    color: var(--theme-text-secondary);
    line-height: 1.4;
}

#refresh-sol-price-btn:hover {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
}

#estimated-cost-section p strong#selected-ai-model-display {
    color: var(--theme-text);
    font-weight: 600;
}

.estimated-price-container {
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
}

.price-sol-primary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-sol-primary strong#total-estimated-price-sol-display {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--theme-bullish);
    line-height: 1.2;
}

.price-sol-primary strong#total-estimated-price-sol-display:empty::before {
    content: "-.---- SOL";
    opacity: 0.7;
}

#refresh-sol-price-btn {
    background-color: transparent;
    color: var(--theme-text-secondary);
    border: 1px solid var(--theme-border);
    padding: 4px 8px;
    font-size: 0.75em;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

#refresh-sol-price-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#refresh-sol-price-btn i.fa-spin {
    animation: fa-spin 1.5s linear infinite;
}

.price-usd-secondary {
    font-size: 0.9em;
    color: var(--theme-text-secondary);
    margin-top: 2px;
    padding-left: 2px;
}

.price-usd-secondary span#total-estimated-price-usd-display {
    font-weight: 500;
}

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

#pair-settings-save-status {
    margin-left: 1rem;
    font-size: 0.9rem;
}

/* Indicators Mode Hint */
.indicators-mode-hint {
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
    font-style: italic;
    margin-left: 5px;
}

/* --- Countdown Specific Styles (Replace the previous countdown styles with this block) --- */

/* Style for the container div holding the countdown label and value */
.pair-meta-item.countdown-item {
    display: flex;
    align-items: center;
    /* gap: 0.4rem; */ /* Removed, rely on internal spacing */
    padding: 0.1rem 0;
    margin-top: 0.2rem;
    font-size: 0.85rem; /* Slightly smaller font */
}

/* Style for the label part, e.g., "⏰ Next Report:" */
.countdown-item > .meta-label {
    display: flex;
    align-items: center;
    /* gap: 0.3rem; */ /* Removed, rely on internal spacing or icon font */
    color: var(--theme-text-secondary); /* Default icon/text color */
    font-weight: normal;
    margin-right: 0.4rem; /* Space between label and value */
    flex-shrink: 0;
}

/* Style for the value part, e.g., "1h 24m" */
.countdown-item > .meta-value.countdown-display {
    font-weight: 600; /* Make the time stand out */
    /* Base color - for 'active' state or default */
    color: var(--theme-bullish); /* Green */
    transition: color 0.3s ease; /* Smooth color transition */
}

/* Specific colors for different countdown states on the VALUE */
.countdown-item > .meta-value.countdown-display.soon {
    color: var(--theme-neutral); /* Orange/Yellow */
}

.countdown-item > .meta-value.countdown-display.imminent {
    color: var(--theme-bearish); /* Red */
}

.countdown-item > .meta-value.countdown-display.error {
    color: var(--theme-bearish); /* Red for errors */
}

.countdown-item > .meta-value.countdown-display.running {
    color: var(--theme-text-secondary); /* Gray for running status */
    font-style: italic;
}

/* --- Optional: If the icon is a separate element (not plain text like '⏰') --- */
/* Uncomment and adjust if your HTML has an actual <i> or <span> for the icon */

.countdown-item .countdown-icon {
    margin-right: 0.3rem;
    transition: color 0.3s ease;
    color: var(--theme-text-secondary); 
}
.countdown-item .countdown-icon.active { color: var(--theme-bullish); }
.countdown-item .countdown-icon.soon { color: var(--theme-neutral); }
.countdown-item .countdown-icon.imminent { color: var(--theme-bearish); }


/* --- Status Indicator (Updated at...) - Ensure this exists and is specific --- */
.countdown-status-indicator {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--theme-text-secondary);
    /* margin-right: 1rem; */ /* Handled by flex gap in .section-actions */
    white-space: nowrap;
    flex-shrink: 0;
}

.countdown-status-indicator.idle {
    color: var(--theme-text-secondary);
}

.countdown-status-indicator.updating {
    color: var(--theme-accent);
    font-style: italic;
}

.countdown-status-indicator.error {
    color: var(--theme-bearish);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .analysis-path-selection {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .path-card {
        padding: 1.2rem;
    }

    .path-card-header {
        gap: 0.6rem;
    }

    .path-card-header h4 {
        font-size: 1rem;
    }

    #indicator-selection,
    #strategy-selection {
        grid-template-columns: 1fr;
    }

    .indicator-category-group {
        grid-template-columns: 1fr;
    }

    .section-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .section-header-bar h2 {
        font-size: 1.3rem;
    }
}