/* Modern Design System */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

* {
  box-sizing: border-box;
}

.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 #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #212529;
  background: linear-gradient(to bottom right, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Moved from Pages/Shared/_Layout.cshtml.css (CSS isolation not required for layout) */
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

a.navbar-brand {
  white-space: normal;
  text-align: center;
  word-break: break-all;
}

a {
  color: #0077cc;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #0e8078 0%, #2fcc67 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.btn-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border: none;
  color: white;
}

.btn-info:hover {
  background: linear-gradient(135deg, #3d8cd9 0%, #00d4e6 100%);
  transform: translateY(-2px);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.border-top {
  border-top: 1px solid #e5e5e5;
}
.border-bottom {
  border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
  font-size: 1rem;
  line-height: inherit;
}

.footer {
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

/* Live PnL coloring */
.pnl-cell.pnl-pos {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  font-weight: 600;
}
.pnl-cell.pnl-neg {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  font-weight: 600;
}

/* Enhanced Navigation */
.navbar.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  box-shadow: var(--shadow-md);
}

/* Ensure navbar text is always white with good contrast */
.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-brand {
  color: black !important;
}

    .navbar-dark .navbar-nav .nav-link:hover,
    .navbar-dark .navbar-nav .nav-link:focus,
    .navbar-dark .navbar-brand:hover {
        color: #9C27B0 !important;
    }

.nav-link-hover {
  position: relative;
  transition: var(--transition-base);
  opacity: 0.9;
}

.nav-link-hover:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-link-hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: white;
  transition: width var(--transition-base), left var(--transition-base);
}

.nav-link-hover:hover::after {
  width: 80%;
  left: 10%;
}

.navbar-brand {
  transition: var(--transition-base);
}

.navbar-brand:hover {
  transform: scale(1.05);
}

/* Container improvements */
.container, .container-fluid {
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 2rem;
}

@media (max-width: 768px) {
  .container, .container-fluid {
    padding: 1rem 0.75rem;
    border-radius: 0;
  }
}

/* Improve table aesthetics */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

/* Table wrapper for easy scrolling */
.table-responsive {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Sticky header for scrollable tables */
.table thead th {
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  z-index: 10;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar for tables */
.table-responsive::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 6px;
  border: 2px solid #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408b 100%);
}

/* Better form controls */
.form-control, .form-select {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  border-radius: var(--radius-sm);
}

.form-control:focus, .form-select:focus {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Card improvements */
.card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

/* Utility classes */
.text-monospace {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.cursor-pointer {
  cursor: pointer;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hover link effects */
.hover-link {
  position: relative;
  transition: var(--transition-base);
}

.hover-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width var(--transition-base);
}

.hover-link:hover::after {
  width: 100%;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408b 100%);
}

/* Utility animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideInUp 0.4s ease-out;
}

/* Focus states */
button:focus, a:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* Tooltips enhancement */
.tooltip {
  font-size: 0.875rem;
}

.tooltip-inner {
  background: var(--primary-gradient);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}
