/**
 * Paper Trading Styles - FIXED VERSION
 */

/* Main Container */
.paper-trading-container {
    display: grid;
    gap: 1.5rem;
}

/* Quick Trade Panel */
.quick-trade-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.quick-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.quick-trade-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Instrument Selection */
.instrument-selection {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.instrument-group.full-width {
    grid-column: 1 / -1;
}

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

.instrument-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Select and Input Base Styles */
.instrument-group select,
.instrument-group input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem; /* Space for arrow in select */
    border-radius: 8px;
    border: 1px solid #333;
    background-color: #1a1a1a;
    color: #e5e5e7;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

/* Select Specific - Remove default arrow and add custom */
.instrument-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    /* Single arrow icon */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

/* Input specific */
.instrument-group input[type="number"] {
    padding-right: 0.75rem; /* Normal padding for input */
}

/* Focus states */
.instrument-group select:focus,
.instrument-group input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

/* Hover states */
.instrument-group select:hover,
.instrument-group input:hover {
    border-color: #4ade80;
}

/* Trade Actions */
.trade-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    padding: 1rem;
    border-radius: 10px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.buy-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.sell-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.sell-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Close Actions */
.close-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.close-btn {
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.tp-btn {
    border-color: #10b981;
    color: #10b981;
}

.tp-btn:hover:not(:disabled) {
    background: #10b981;
    color: white;
}

.sl-btn {
    border-color: #ef4444;
    color: #ef4444;
}

.sl-btn:hover:not(:disabled) {
    background: #ef4444;
    color: white;
}

.be-btn {
    border-color: #6b7280;
    color: #6b7280;
}

.be-btn:hover:not(:disabled) {
    background: #6b7280;
    color: white;
}

.close-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Strategy Section */
.strategy-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.strategy-select-group {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.add-strategy-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    animation: slideDown 0.3s ease;
}

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

.add-strategy-group input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #e5e5e7;
}

.add-strategy-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.add-strategy-btn:hover {
    background: var(--primary-dark);
}

/* Notes Section */
.notes-section {
    margin-top: 1rem;
}

.notes-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.notes-section textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #e5e5e7;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    box-sizing: border-box;
}

.notes-section textarea:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

/* Active Trade Display */
.active-trade-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.active-trade-card {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: 10px;
    padding: 1.25rem;
    border: 2px solid;
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.active-trade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: sweep 3s infinite;
}

@keyframes sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.active-trade-card.buy {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.active-trade-card.sell {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.005);
    }
}

/* Trade Status Badge */
.trade-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: blink 1.5s infinite;
}

.trade-status.active {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trade-instrument {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trade-direction {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.trade-direction.buy {
    background: #10b981;
    color: white;
}

.trade-direction.sell {
    background: #ef4444;
    color: white;
}

.trade-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.detail-item span:first-child {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.detail-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-item .positive {
    color: #10b981;
}

.detail-item .negative {
    color: #ef4444;
}

/* No Active Trade */
.no-active-trade {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.no-active-trade i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Stats Grid */
.paper-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.paper-stat-card {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #333;
    text-align: center;
}

.paper-stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.paper-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.paper-stat-value.positive {
    color: #10b981;
}

.paper-stat-value.negative {
    color: #ef4444;
}

/* Recent Trades */
.recent-trades-section {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #333;
}

.recent-trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.recent-trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid;
    transition: all 0.2s;
}

.recent-trade-item:hover {
    transform: translateX(4px);
}

.recent-trade-item.win {
    border-left-color: #10b981;
}

.recent-trade-item.loss {
    border-left-color: #ef4444;
}

.trade-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trade-info .instrument {
    font-weight: 600;
    color: var(--text-primary);
}

.trade-info .direction {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.trade-info .direction.buy {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.trade-info .direction.sell {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.trade-info .outcome {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.trade-info .outcome.timeout {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    font-weight: 600;
}

.trade-result {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trade-result .pnl {
    font-weight: 600;
    font-size: 0.95rem;
}

.trade-result .time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Strategy Performance */
.strategy-performance {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.strategy-stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.strategy-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
}

.trade-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.strategy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.strategy-stats .stat {
    text-align: center;
}

.strategy-stats .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.strategy-stats .value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.win-rate-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state i {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Reset Button */
.reset-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.reset-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #ef4444;
    background: transparent;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #ef4444;
    color: white;
}

/* Light Theme Overrides */
html.light .instrument-group select,
html.light .instrument-group input,
html.light .notes-section textarea,
html.light .add-strategy-group input {
    background-color: #ffffff;
    border-color: #e5e7eb;
    color: #111827;
}

html.light .instrument-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

html.light .instrument-group select:focus,
html.light .instrument-group input:focus,
html.light .notes-section textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

html.light .paper-stat-card,
html.light .quick-trade-panel,
html.light .active-trade-section,
html.light .recent-trades-section {
    background: #ffffff;
    border-color: #e5e7eb;
}

html.light .detail-item {
    background: #f9fafb;
}

html.light .recent-trade-item {
    background: #f9fafb;
}

html.light .strategy-stat-card {
    background: #f9fafb;
    border-color: #e5e7eb;
}

html.light .trade-count {
    background: #f3f4f6;
}

html.light .win-rate-bar {
    background: #e5e7eb;
}

/* Trading Summaries */
.trading-summaries {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.summary-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.daily-summary {
    border-left: 3px solid #f59e0b;
}

.weekly-summary {
    border-left: 3px solid #3b82f6;
}

.monthly-summary {
    border-left: 3px solid #8b5cf6;
}

.summary-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-stat .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.summary-stat .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-stat .value.positive {
    color: #10b981;
}

.summary-stat .value.negative {
    color: #ef4444;
}

/* Warning Box */
.warning-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.875rem;
}

.warning-box i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Mini Charts */
.mini-chart {
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.5rem;
}

.mini-chart-bars {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    height: 100%;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.bar {
    width: 40px;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
}

.win-bar {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.loss-bar {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 1rem;
}

/* Light Theme Overrides for Summaries */
html.light .trading-summaries {
    background: #ffffff;
    border-color: #e5e7eb;
}

html.light .summary-card {
    background: #f9fafb;
    border-color: #e5e7eb;
}

html.light .warning-box {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Export Button */
.export-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #3b82f6;
    background: transparent;
    color: #3b82f6;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.export-btn i {
    width: 18px;
    height: 18px;
}

/* Multiple Active Trades Styles */
.active-trades-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.active-trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.active-trades-header span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Individual Trade Actions */
.trade-actions-individual {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-close-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.mini-close-btn.tp {
    border-color: #10b981;
    color: #10b981;
}

.mini-close-btn.tp:hover {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mini-close-btn.sl {
    border-color: #ef4444;
    color: #ef4444;
}

.mini-close-btn.sl:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.mini-close-btn.be {
    border-color: #6b7280;
    color: #6b7280;
}

.mini-close-btn.be:hover {
    background: #6b7280;
    color: white;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Trade Timer Styling */
.trade-timer {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.trade-timer.warning {
    color: #f59e0b !important;
    animation: pulse-warning 1s infinite;
}

.trade-timer.danger {
    color: #ef4444 !important;
    animation: pulse-danger 0.5s infinite;
}

/* Current Price & Floating Pips */
.current-price {
    font-variant-numeric: tabular-nums;
    color: #9ca3af;
}

.floating-pips {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.floating-pips.positive {
    color: #10b981;
}

.floating-pips.negative {
    color: #ef4444;
}

/* Manual Pips Input */
.manual-pips-input {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.pips-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pips-input,
.percent-input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.pips-input:focus,
.percent-input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.pips-input::placeholder,
.percent-input::placeholder {
    color: #666;
    font-weight: 400;
}

.pips-separator {
    color: #666;
    font-size: 0.875rem;
    padding: 0 0.25rem;
}

.convert-btn {
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: #222;
    color: #4ade80;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convert-btn:hover {
    background: #333;
    border-color: #4ade80;
}

.convert-btn i {
    width: 16px;
    height: 16px;
}

.pips-help-text {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Input con resultado positivo */
.pips-input.positive {
    border-color: #10b981;
    color: #10b981;
}

/* Input con resultado negativo */
.pips-input.negative {
    border-color: #ef4444;
    color: #ef4444;
}

/* Trade Notes */
.trade-notes {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-notes small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Timer Styles */
#tradeTimer {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

#tradeTimer.warning {
    color: #f59e0b !important;
    animation: pulse-warning 1s infinite;
}

#tradeTimer.danger {
    color: #ef4444 !important;
    animation: pulse-danger 0.5s infinite;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-danger {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Enhanced Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 20px;
    border-radius: 8px;
    background: #1a1a1a;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: 4px solid #065f46;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-left: 4px solid #7f1d1d;
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-left: 4px solid #78350f;
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-left: 4px solid #1e3a8a;
}

.toast i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast span {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .paper-trading-container {
        gap: 1rem;
    }
    
    .trade-actions {
        grid-template-columns: 1fr;
    }
    
    .close-actions {
        grid-template-columns: 1fr;
    }
    
    .instrument-selection {
        grid-template-columns: 1fr;
    }
    
    .instrument-group.full-width {
        grid-column: 1;
    }
    
    .strategy-select-group {
        grid-template-columns: 1fr;
    }
    
    .paper-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .trade-details {
        grid-template-columns: 1fr;
    }
    
    .strategy-performance {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   TRADE REVIEW MODAL
   ===================================================== */

.modal-review {
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-review .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-title-group i {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.modal-title-group h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.review-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-badge.win {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.review-badge.loss {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.modal-review .modal-body {
    padding: 1.5rem;
}

.review-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.review-questions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    gap: 1rem;
}

.question-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
}

.btn-group-yesno {
    display: flex;
    gap: 0.5rem;
}

.btn-yesno {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-yesno:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-yesno.selected[data-value="yes"] {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: white;
}

.btn-yesno.selected[data-value="no"] {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: white;
}

/* Emotion selector */
.emotion-selector {
    display: flex;
    gap: 0.5rem;
}

.btn-emotion {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-emotion:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.btn-emotion.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Notes textarea */
.review-notes {
    margin-top: 0.5rem;
}

.review-notes label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.review-notes textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.875rem;
    resize: vertical;
    font-family: inherit;
}

.review-notes textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.review-notes textarea::placeholder {
    color: var(--text-muted);
}

/* Modal footer */
.modal-review .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 480px) {
    .review-question {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-group-yesno {
        width: 100%;
    }

    .btn-yesno {
        flex: 1;
    }

    .emotion-selector {
        width: 100%;
        justify-content: space-between;
    }

    .btn-emotion {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

/* =====================================================
   TRADE REVIEWS SECTION
   ===================================================== */

.trade-reviews-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.reviews-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.1rem;
}

.reviews-header h3 i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.reviews-filters {
    display: flex;
    gap: 0.5rem;
}

.reviews-filters select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.reviews-filters select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Reviews Stats */
.reviews-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.review-stat {
    text-align: center;
}

.review-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.review-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-stat-value.positive { color: var(--success); }
.review-stat-value.negative { color: var(--danger); }
.review-stat-value.warning { color: var(--warning); }

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.review-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.review-item:hover {
    border-color: var(--primary);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.review-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.review-item-instrument {
    font-weight: 600;
    color: var(--text-primary);
}

.review-item-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.review-item-badge.win {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.review-item-badge.loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.review-item-pips {
    font-weight: 600;
    font-size: 0.9rem;
}

.review-item-pips.positive { color: var(--success); }
.review-item-pips.negative { color: var(--danger); }

.review-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.review-item-emotion {
    font-size: 1.25rem;
}

/* Review Answers */
.review-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.review-answer-tag {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.review-answer-tag.yes {
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.review-answer-tag.no {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.review-answer-tag i {
    width: 12px;
    height: 12px;
}

/* Review Notes */
.review-item-notes {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    border-left: 3px solid var(--primary);
}

/* Export buttons */
.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reviews-filters {
        width: 100%;
    }

    .reviews-filters select {
        flex: 1;
    }

    .reviews-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .review-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .export-buttons {
        width: 100%;
    }

    .export-buttons .btn {
        flex: 1;
    }
}
