/* TradeVek Free Trading Tools - Premium Responsive & Mobile-Friendly CSS */

/* Glassmorphism & Custom Card Styles */
.tool-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 20px 30px -10px rgba(37, 99, 235, 0.08), 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
}

/* Calculator Input Panels */
.calc-input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.calc-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.6875rem 0.875rem;
    font-size: 1rem; /* 16px base font prevents iOS Safari auto-zoom on mobile */
    font-weight: 600;
    color: #0f172a;
    background-color: #ffffff;
    min-height: 44px; /* Accessible 44px mobile touch target */
    transition: all 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.calc-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.calc-input-prefix {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
}

.calc-input-with-prefix {
    padding-left: 2.25rem;
}

.calc-input-suffix {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    pointer-events: none;
}

.calc-input-with-suffix {
    padding-right: 2.5rem;
}

/* Segmented Control / Radio Buttons (Touch-Friendly) */
.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    width: 100%;
    gap: 0.25rem;
}

.segmented-option {
    flex: 1;
    text-align: center;
    padding: 0.625rem 0.75rem;
    min-height: 44px; /* Accessible 44px mobile touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #64748b;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.segmented-option.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Trade Direction Specific Styling (Buy: Green, Sell: Red) */
.segmented-option[data-dir="long"] {
    color: #475569;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.segmented-option[data-dir="long"]:hover:not(.active) {
    color: #16a34a;
    background-color: #f0fdf4;
}

.segmented-option[data-dir="long"].active {
    background: #16a34a;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px -1px rgba(22, 163, 74, 0.35), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.segmented-option[data-dir="long"].active i {
    color: #ffffff !important;
}

.segmented-option[data-dir="short"] {
    color: #475569;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.segmented-option[data-dir="short"]:hover:not(.active) {
    color: #dc2626;
    background-color: #fef2f2;
}

.segmented-option[data-dir="short"].active {
    background: #dc2626;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px -1px rgba(220, 38, 38, 0.35), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.segmented-option[data-dir="short"].active i {
    color: #ffffff !important;
}

/* Quick Preset Chips (Touch-Friendly) */
.preset-chip {
    padding: 0.375rem 0.75rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.preset-chip:hover, .preset-chip.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

/* Result Metric Cards */
.result-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    min-width: 0; /* Prevents flex/grid item overflow blowout */
}

.result-card.primary {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-color: #bfdbfe;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-value {
    font-size: clamp(1.125rem, 4vw, 1.375rem); /* Fluid scaling for mobile screens */
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    word-break: break-word;
    overflow-wrap: break-word;
}

.result-value.highlight-green {
    color: #16a34a;
}

.result-value.highlight-red {
    color: #dc2626;
}

.result-value.highlight-blue {
    color: #2563eb;
}

/* Visual Risk-Reward Meter */
.rr-meter {
    height: 12px;
    border-radius: 9999px;
    display: flex;
    overflow: hidden;
    background: #f1f5f9;
}

.rr-meter-risk {
    background: #ef4444;
    transition: width 0.3s ease;
}

.rr-meter-reward {
    background: #10b981;
    transition: width 0.3s ease;
}

/* Toast Notification for Clipboard Copy */
#toolsToast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#toolsToast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* FAQ Details Styling */
.tool-faq details {
    transition: all 0.2s ease;
}

.tool-faq details[open] summary svg {
    transform: rotate(180deg);
}

.tool-faq summary::-webkit-details-marker {
    display: none;
}

/* Smooth Horizontal Scroll on Mobile Tables */
.table-responsive-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Responsive Adjustments (Screens <= 640px) */
@media (max-width: 640px) {
    .result-card {
        padding: 0.875rem 1rem;
    }
    
    .result-label {
        font-size: 0.6875rem;
    }
    
    #toolsToast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        justify-content: center;
        text-align: center;
    }

    .segmented-option {
        font-size: 0.75rem;
        padding: 0.5rem 0.375rem;
    }

    .calc-input-group label {
        font-size: 0.75rem;
    }
}
