﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    line-height: 1.6;
}

/* Currency Symbol Rendering */
.currency-symbol,
.currency-value,
.price-display,
.pnl-display {
    font-feature-settings: "tnum" 1; /* Tabular numbers for better alignment */
    -webkit-font-feature-settings: "tnum" 1;
    -moz-font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
}

/* Ensure Indian Rupee symbol renders correctly */
.currency-inr::before,
.rupee-symbol::before {
    content: "₹";
    font-weight: normal;
    margin-right: 0.125rem;
}

/* Better currency formatting for tables and cards */
.currency-amount {
    text-align: right;
    font-feature-settings: "tnum" 1;
    white-space: nowrap;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced focus styles for accessibility */
h1:focus {
    outline: none;
}

a, .btn-link {
    color: #2563eb;
}

.btn-primary {
    color: #fff;
    background-color: #2563eb;
    border-color: #1d4ed8;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #93c5fd;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10b981;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #ef4444;
}

/* Enhanced Trading-specific styles */
.profit {
    color: #10b981 !important;
    font-weight: 600;
}

.loss {
    color: #ef4444 !important;
    font-weight: 600;
}

.neutral {
    color: #6b7280 !important;
}

/* Enhanced Card hover effects - more subtle */
.card-hover {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Enhanced scrollbar for better UX */
.custom-scrollbar::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    border: 2px solid #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dark mode scrollbar */
.dark .custom-scrollbar::-webkit-scrollbar-track {
    background: #374151;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-color: #374151;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Enhanced Pulse animation */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Market status indicator with enhanced animation */
.market-open {
    animation: pulse 2s infinite;
    color: #10b981;
}

/* Enhanced Position and P&L indicators */
.pnl-positive {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-left: 4px solid #10b981;
}

.pnl-negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.pnl-neutral {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    border-left: 4px solid #94a3b8;
}

/* Enhanced Error UI */
#blazor-error-ui {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    bottom: 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    display: none;
    left: 0;
    padding: 0.8rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 3px solid #f59e0b;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    font-size: 1.2rem;
    color: #92400e;
    transition: color 0.2s;
}

#blazor-error-ui .dismiss:hover {
    color: #78350f;
}

.blazor-error-boundary {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    padding: 1.5rem 1rem 1.5rem 4rem;
    color: #991b1b;
    border-left: 5px solid #dc2626;
    border-radius: 0.5rem;
    margin: 1rem 0;
    position: relative;
}

.blazor-error-boundary::before {
    content: "⚠️";
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page or contact support.";
    font-weight: 500;
}

/* Enhanced Professional Styling */
html, body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Loading animation */
.loading-spinner {
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Professional card styling */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* Dark mode card styling */
.dark .card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Enhanced Status indicators */
.status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

.status-active {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 3px solid #10b981;
}

.status-triggered {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

/* Enhanced Profit/Loss coloring */
.profit {
    color: #059669;
    font-weight: 600;
}

.loss {
    color: #dc2626;
    font-weight: 600;
}

/* Enhanced Responsive grid adjustments */
@media (max-width: 768px) {
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        margin: 0.5rem 0;
        border-radius: 8px;
    }
}

/* Enhanced Trading form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Dark mode form styling */
.dark .form-label {
    color: #f3f4f6;
}

.dark .form-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Enhanced Button styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Table styling */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    background: white;
}

.table th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    transform: scale(1.01);
}

/* Dark mode table styling */
.dark .table-container {
    border-color: #374151;
}

.dark .table {
    background: #1f2937;
}

.dark .table th {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    color: #f3f4f6;
    border-color: #4b5563;
}

.dark .table td {
    border-color: #374151;
}

.dark .table tbody tr:hover {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

/* Enhanced Dashboard metrics cards */
.metric-card {
    background: white;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dark mode metric cards */
.dark .metric-card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .metric-value {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Enhanced Position size calculator */
.calculator-result {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.dark .calculator-result {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #3b82f6;
}

/* Enhanced Notification styles */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 50;
    max-width: 28rem;
    border-left: 4px solid;
}

.notification-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
    color: #065f46;
}

.notification-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
    color: #991b1b;
}

/* Enhanced Animation utilities */
.slide-down {
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Footer enhancements */
.footer-link {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link:hover {
    transform: translateY(-1px);
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
