/**
 * Prop Firm Consistency Calculator Styles
 * Dark Professional Investment Theme
 * Version: 1.0.1 - Fixed Currency Overlap Issue
 */

/* CSS Variables */
:root {
    --pfc-bg-primary: #0a0e17;
    --pfc-bg-secondary: #0f1419;
    --pfc-bg-tertiary: #151c28;
    --pfc-bg-card: #1a2332;
    --pfc-bg-input: #0d1117;
    --pfc-border-color: #2a3444;
    --pfc-border-light: #3d4f66;
    --pfc-text-primary: #e6edf3;
    --pfc-text-secondary: #8b949e;
    --pfc-text-muted: #6e7681;
    --pfc-accent-primary: #3b82f6;
    --pfc-accent-secondary: #1d4ed8;
    --pfc-accent-glow: rgba(59, 130, 246, 0.3);
    --pfc-success: #10b981;
    --pfc-success-bg: rgba(16, 185, 129, 0.1);
    --pfc-success-border: rgba(16, 185, 129, 0.3);
    --pfc-warning: #f59e0b;
    --pfc-warning-bg: rgba(245, 158, 11, 0.1);
    --pfc-warning-border: rgba(245, 158, 11, 0.3);
    --pfc-error: #ef4444;
    --pfc-error-bg: rgba(239, 68, 68, 0.1);
    --pfc-error-border: rgba(239, 68, 68, 0.3);
    --pfc-gradient-primary: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
    --pfc-gradient-accent: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --pfc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --pfc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --pfc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --pfc-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --pfc-radius-sm: 6px;
    --pfc-radius-md: 10px;
    --pfc-radius-lg: 14px;
    --pfc-radius-xl: 20px;
    --pfc-transition-fast: 150ms ease;
    --pfc-transition-normal: 250ms ease;
    --pfc-transition-slow: 350ms ease;
}

/* Reset and Base */
.pfc-calculator-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--pfc-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pfc-calculator-wrapper *,
.pfc-calculator-wrapper *::before,
.pfc-calculator-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Calculator Container */
.pfc-calculator {
    max-width: 540px;
    margin: 40px auto;
    background: var(--pfc-gradient-primary);
    border: 1px solid var(--pfc-border-color);
    border-radius: var(--pfc-radius-xl);
    box-shadow: var(--pfc-shadow-xl);
    overflow: hidden;
    position: relative;
}

.pfc-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pfc-border-light), transparent);
}

/* Header */
.pfc-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--pfc-border-color);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
}

.pfc-header-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--pfc-bg-card);
    border: 1px solid var(--pfc-border-color);
    border-radius: var(--pfc-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pfc-accent-primary);
}

.pfc-header-icon svg {
    width: 28px;
    height: 28px;
}

.pfc-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pfc-text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.pfc-subtitle {
    font-size: 14px;
    color: var(--pfc-text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Form */
.pfc-form {
    padding: 28px 32px;
}

/* Input Groups */
.pfc-input-group {
    margin-bottom: 24px;
}

.pfc-input-group:last-of-type {
    margin-bottom: 28px;
}

.pfc-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pfc-label-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--pfc-text-primary);
    letter-spacing: -0.01em;
}

.pfc-label-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--pfc-accent-primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: var(--pfc-radius-sm);
    font-variant-numeric: tabular-nums;
}

/* Slider Container */
.pfc-slider-container {
    padding: 8px 0;
}

/* Custom Range Slider - Mobile Optimized */
.pfc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--pfc-bg-input);
    border: 1px solid var(--pfc-border-color);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    touch-action: pan-y;
}

.pfc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--pfc-gradient-accent);
    border: 3px solid var(--pfc-text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: transform var(--pfc-transition-fast), box-shadow var(--pfc-transition-fast);
}

.pfc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.pfc-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

.pfc-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--pfc-gradient-accent);
    border: 3px solid var(--pfc-text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: transform var(--pfc-transition-fast), box-shadow var(--pfc-transition-fast);
}

.pfc-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.pfc-slider::-moz-range-track {
    background: var(--pfc-bg-input);
    border: 1px solid var(--pfc-border-color);
    border-radius: 4px;
    height: 8px;
}

/* Slider Labels */
.pfc-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
    color: var(--pfc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Input Wrapper - FIXED: Currency symbol outside input to prevent overlap */
.pfc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pfc-input-prefix {
    font-size: 18px;
    font-weight: 700;
    color: var(--pfc-text-primary);
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pfc-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--pfc-text-primary);
    background: var(--pfc-bg-input);
    border: 1px solid var(--pfc-border-color);
    border-radius: var(--pfc-radius-md);
    outline: none;
    transition: border-color var(--pfc-transition-fast), box-shadow var(--pfc-transition-fast);
    font-variant-numeric: tabular-nums;
}

.pfc-input:hover {
    border-color: var(--pfc-border-light);
}

.pfc-input:focus {
    border-color: var(--pfc-accent-primary);
    box-shadow: 0 0 0 3px var(--pfc-accent-glow);
}

.pfc-input::placeholder {
    color: var(--pfc-text-muted);
}

/* Remove number input spinners */
.pfc-input::-webkit-outer-spin-button,
.pfc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pfc-input[type=number] {
    -moz-appearance: textfield;
}

/* Input Hints */
.pfc-input-hint {
    font-size: 12px;
    color: var(--pfc-text-muted);
    margin-top: 8px;
    margin-bottom: 0;
}

/* Buttons */
.pfc-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: var(--pfc-gradient-accent);
    border: none;
    border-radius: var(--pfc-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform var(--pfc-transition-fast), box-shadow var(--pfc-transition-fast), opacity var(--pfc-transition-fast);
    position: relative;
    overflow: hidden;
}

.pfc-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.pfc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.pfc-button:active {
    transform: translateY(0);
}

.pfc-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pfc-button-secondary {
    background: var(--pfc-bg-card);
    border: 1px solid var(--pfc-border-color);
    color: var(--pfc-text-secondary);
}

.pfc-button-secondary:hover {
    background: var(--pfc-bg-tertiary);
    border-color: var(--pfc-border-light);
    box-shadow: var(--pfc-shadow-md);
    color: var(--pfc-text-primary);
}

/* Button Loader */
.pfc-button-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: pfc-spin 0.8s linear infinite;
}

.pfc-button.loading .pfc-button-text {
    opacity: 0;
}

.pfc-button.loading .pfc-button-loader {
    display: block;
    position: absolute;
}

@keyframes pfc-spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.pfc-results {
    padding: 0 32px 32px;
    animation: pfc-fadeIn 0.4s ease;
}

@keyframes pfc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Indicator */
.pfc-status {
    text-align: center;
    padding: 28px;
    border-radius: var(--pfc-radius-lg);
    margin-bottom: 24px;
    border: 1px solid;
}

.pfc-status.success {
    background: var(--pfc-success-bg);
    border-color: var(--pfc-success-border);
}

.pfc-status.warning {
    background: var(--pfc-warning-bg);
    border-color: var(--pfc-warning-border);
}

.pfc-status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pfc-status.success .pfc-status-icon {
    background: var(--pfc-success);
}

.pfc-status.warning .pfc-status-icon {
    background: var(--pfc-warning);
}

.pfc-status-icon svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.pfc-status-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.pfc-status.success .pfc-status-title {
    color: var(--pfc-success);
}

.pfc-status.warning .pfc-status-title {
    color: var(--pfc-warning);
}

.pfc-status-message {
    font-size: 14px;
    color: var(--pfc-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Metrics Grid */
.pfc-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.pfc-metric {
    background: var(--pfc-bg-card);
    border: 1px solid var(--pfc-border-color);
    border-radius: var(--pfc-radius-md);
    padding: 16px;
    text-align: center;
}

.pfc-metric-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--pfc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.pfc-metric-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--pfc-text-primary);
    font-variant-numeric: tabular-nums;
}

/* Progress Section */
.pfc-progress-section {
    background: var(--pfc-bg-card);
    border: 1px solid var(--pfc-border-color);
    border-radius: var(--pfc-radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.pfc-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
}

.pfc-progress-header span:first-child {
    color: var(--pfc-text-secondary);
}

.pfc-progress-header span:last-child {
    color: var(--pfc-accent-primary);
    font-variant-numeric: tabular-nums;
}

.pfc-progress-bar {
    position: relative;
    height: 10px;
    background: var(--pfc-bg-input);
    border-radius: 5px;
    overflow: visible;
    border: 1px solid var(--pfc-border-color);
}

.pfc-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease, background 0.3s ease;
    position: relative;
}

.pfc-progress-fill.success {
    background: linear-gradient(90deg, var(--pfc-success), #34d399);
}

.pfc-progress-fill.warning {
    background: linear-gradient(90deg, var(--pfc-warning), #fbbf24);
}

.pfc-progress-marker {
    position: absolute;
    top: -6px;
    width: 2px;
    height: 22px;
    background: var(--pfc-text-primary);
    border-radius: 1px;
    transition: left 0.3s ease;
}

.pfc-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: var(--pfc-text-muted);
}

/* Additional Profit Section */
.pfc-additional {
    background: var(--pfc-warning-bg);
    border: 1px solid var(--pfc-warning-border);
    border-radius: var(--pfc-radius-md);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.pfc-additional-header {
    margin-bottom: 12px;
}

.pfc-additional-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pfc-warning);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pfc-additional-content {
    text-align: center;
}

.pfc-additional-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.pfc-currency {
    font-size: 24px;
    font-weight: 600;
    color: var(--pfc-text-secondary);
}

.pfc-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--pfc-text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.pfc-additional-note {
    font-size: 13px;
    color: var(--pfc-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Breakdown Table */
.pfc-breakdown {
    background: var(--pfc-bg-card);
    border: 1px solid var(--pfc-border-color);
    border-radius: var(--pfc-radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.pfc-breakdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pfc-text-primary);
    margin: 0 0 16px;
}

.pfc-breakdown-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pfc-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--pfc-bg-input);
    border-radius: var(--pfc-radius-sm);
}

.pfc-breakdown-row-highlight {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.pfc-breakdown-label {
    font-size: 13px;
    color: var(--pfc-text-secondary);
}

.pfc-breakdown-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--pfc-text-primary);
    font-variant-numeric: tabular-nums;
}

.pfc-breakdown-row-highlight .pfc-breakdown-value {
    color: var(--pfc-accent-primary);
}

/* Footer */
.pfc-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--pfc-border-color);
    background: rgba(0, 0, 0, 0.2);
}

.pfc-disclaimer {
    font-size: 11px;
    color: var(--pfc-text-muted);
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* Error States */
.pfc-input.error {
    border-color: var(--pfc-error);
}

.pfc-input.error:focus {
    box-shadow: 0 0 0 3px var(--pfc-error-bg);
}

.pfc-error-message {
    color: var(--pfc-error);
    font-size: 12px;
    margin-top: 6px;
}

/* Responsive Styles */
@media (max-width: 600px) {
    .pfc-calculator {
        margin: 20px 16px;
        border-radius: var(--pfc-radius-lg);
    }

    .pfc-header {
        padding: 24px 20px 20px;
    }

    .pfc-title {
        font-size: 20px;
    }

    .pfc-form {
        padding: 20px;
    }

    .pfc-results {
        padding: 0 20px 24px;
    }

    .pfc-footer {
        padding: 16px 20px;
    }

    /* Mobile Slider Optimization */
    .pfc-slider {
        height: 10px;
    }

    .pfc-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .pfc-slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }

    .pfc-slider-labels {
        font-size: 10px;
    }

    .pfc-slider-labels span:nth-child(2),
    .pfc-slider-labels span:nth-child(3),
    .pfc-slider-labels span:nth-child(4) {
        display: none;
    }

    .pfc-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pfc-metric {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
        text-align: left;
    }

    .pfc-metric-label {
        margin-bottom: 0;
    }

    .pfc-amount {
        font-size: 28px;
    }

    .pfc-currency {
        font-size: 20px;
    }

    .pfc-status {
        padding: 20px;
    }

    .pfc-status-icon {
        width: 52px;
        height: 52px;
    }

    .pfc-status-icon svg {
        width: 26px;
        height: 26px;
    }

    .pfc-status-title {
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    .pfc-calculator {
        margin: 16px 12px;
    }

    .pfc-header {
        padding: 20px 16px;
    }

    .pfc-form,
    .pfc-results {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pfc-footer {
        padding: 14px 16px;
    }

    .pfc-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .pfc-button {
        padding: 14px 20px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .pfc-slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
    }

    .pfc-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }

    .pfc-button:hover {
        transform: none;
    }

    .pfc-button:active {
        transform: scale(0.98);
    }
}

/* Print Styles */
@media print {
    .pfc-calculator-wrapper {
        color: #000;
    }

    .pfc-calculator {
        box-shadow: none;
        border: 1px solid #ccc;
        background: #fff;
    }

    .pfc-button {
        display: none;
    }
}