/**
 * Trading Station Calculators Styles
 * Theme colors: Gold #f6cb53, Olive Green #7e9855, Dark #060607, Light #fcfcf9
 */

/* Calculator Container */
.ts-calculator {
    background: #ffffff;
    border: 2px solid #f6cb53;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.ts-calculator:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Calculator Title */
.ts-calc-title {
    color: #060607;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f6cb53;
}

.ts-calc-description {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Input Groups */
.ts-calc-inputs {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.ts-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ts-input-group label {
    font-weight: 600;
    color: #060607;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ts-input-group input,
.ts-input-group select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fcfcf9;
}

.ts-input-group input:focus,
.ts-input-group select:focus {
    outline: none;
    border-color: #7e9855;
    box-shadow: 0 0 0 3px rgba(126, 152, 85, 0.15);
}

.ts-input-group small {
    color: #777;
    font-size: 0.8rem;
}

/* Fetch Price Button */
.ts-fetch-price-btn {
    background: #7e9855;
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.ts-fetch-price-btn:hover {
    background: #6a8347;
}

/* Price Status */
.ts-price-status {
    font-size: 0.8rem;
    color: #777;
}

.ts-price-status.ts-loading {
    color: #f6cb53;
}

.ts-price-status.ts-success {
    color: #7e9855;
}

.ts-price-status.ts-error {
    color: #d9534f;
}

.ts-price-status .ts-positive {
    color: #7e9855;
}

.ts-price-status .ts-negative {
    color: #d9534f;
}

/* Calculate Button */
.ts-calc-button {
    background: linear-gradient(135deg, #f6cb53 0%, #e5b840 100%);
    color: #060607;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.ts-calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(246, 203, 83, 0.4);
}

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

/* Results Section */
.ts-calc-results {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid #e9ecef;
}

.ts-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #e9ecef;
}

.ts-result-row:last-child {
    border-bottom: none;
}

.ts-result-label {
    color: #555;
    font-size: 0.95rem;
}

.ts-result-value {
    font-weight: 600;
    color: #060607;
    font-size: 1rem;
}

.ts-result-summary {
    background: #fff;
    margin: 0.5rem -0.75rem;
    padding: 0.875rem 0.75rem;
    border-radius: 6px;
    border: 2px solid #f6cb53;
}

.ts-result-summary .ts-result-label,
.ts-result-summary .ts-result-value {
    font-size: 1.1rem;
}

/* Highlight Colors */
.ts-highlight-success {
    color: #7e9855 !important;
}

.ts-highlight-warning {
    color: #d9534f !important;
}

.ts-highlight-neutral {
    color: #f0ad4e !important;
}

/* Note Text */
.ts-calc-note {
    color: #777;
    font-size: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #ddd;
}

.ts-calc-note a {
    color: #7e9855;
    text-decoration: none;
}

.ts-calc-note a:hover {
    text-decoration: underline;
}

/* Calculator-Specific Styles */
.ts-il-calculator {
    border-color: #f6cb53;
}

.ts-apy-calculator {
    border-color: #7e9855;
}

.ts-apy-calculator .ts-calc-title {
    border-bottom-color: #7e9855;
}

.ts-yield-calculator {
    border-color: #f6cb53;
}

.ts-position-calculator {
    border-color: #7e9855;
}

.ts-position-calculator .ts-calc-title {
    border-bottom-color: #7e9855;
}

.ts-gas-calculator {
    border-color: #f6cb53;
}

/* Responsive Design */
@media (max-width: 600px) {
    .ts-calculator {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    .ts-calc-title {
        font-size: 1.25rem;
    }

    .ts-input-group label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ts-fetch-price-btn {
        align-self: flex-start;
    }

    .ts-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .ts-result-value {
        font-size: 1.1rem;
    }
}

/* Dark Mode Support (if theme has dark mode) */
@media (prefers-color-scheme: dark) {
    .ts-calculator.dark-mode {
        background: #1a1a1a;
        border-color: #f6cb53;
    }

    .ts-calculator.dark-mode .ts-calc-title {
        color: #fcfcf9;
    }

    .ts-calculator.dark-mode .ts-input-group input,
    .ts-calculator.dark-mode .ts-input-group select {
        background: #2a2a2a;
        border-color: #444;
        color: #fcfcf9;
    }

    .ts-calculator.dark-mode .ts-calc-results {
        background: #2a2a2a;
        border-color: #444;
    }
}

/* Animation for loading state */
@keyframes ts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ts-loading {
    animation: ts-pulse 1.5s infinite;
}

/* Multiple calculators on same page */
.ts-calculator + .ts-calculator {
    margin-top: 2.5rem;
}
