/* Clean, modern, minimal TradingView-inspired styles */

body {
    font-family: 'Inter', sans-serif;
    color: #222;
    background: #f8fafc;
    min-height: 100vh;
}

/* Navbar */
.tv-navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    height: 56px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tv-navbar-container {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    height: 56px;
}
.tv-navbar-logo {
    height: 40px;
    width: auto;
    margin-right: 20px;
    object-fit: contain;
    display: block;
}
.tv-navbar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 24px;
}
.tv-navbar-link, .tv-navbar-link:hover, .tv-navbar-link.active {
    font-size: 1.08rem;
    font-weight: 500;
    color: #222;
    text-decoration: none !important;
    padding: 8px 22px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.tv-navbar-link:hover,
.tv-navbar-link.active {
    color: #fff;
    background: linear-gradient(90deg, #1976d2 0%, #764ba2 100%);
}

/* Main content */
.main-content {
    width: 100%;
    margin: 80px auto 0 auto;
    padding: 0 4vw 32px 4vw;
    box-sizing: border-box;
    max-width: none;
}

/* Card */
.card-custom {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 28px 24px 28px;
    margin-bottom: 32px;
    min-width: 0;
    width: 100%;
    max-width: none;
}
.card-custom h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #1976d2 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    color: transparent;
}

/* Form */
.form-control {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 1.08rem;
    box-shadow: none;
    background: #fff;
    color: #222;
}
.form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #e3e8ef;
}
.form-control:not(textarea) {
    height: 44px;
}
textarea.form-control {
    min-height: 160px;
    height: auto;
    resize: vertical;
}
label {
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.97rem;
    color: #222;
}
.form-check-label {
    font-weight: 400;
    margin-left: 8px;
}

/* Button */
.btn, .btn-primary {
    border-radius: 8px;
    background: linear-gradient(90deg, #1976d2 0%, #764ba2 100%);
    background-size: 200% 100%;
    background-position: 0% 0%;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 28px;
    border: none;
    transition: background-position 0.5s cubic-bezier(.4,0,.2,1);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn:hover, .btn-primary:hover {
    background-position: 100% 0%;
}
.btn:active, .btn-primary:active {
    background-position: 0% 0%;
}

.btn-danger {
    background: linear-gradient(90deg, #dc3545 0%, #a71d2a 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-position 0.5s cubic-bezier(.4,0,.2,1), background 0.5s cubic-bezier(.4,0,.2,1);
    background-size: 200% 100% !important;
    background-position: left center !important;
}
.btn-danger:hover, .btn-danger:active {
    background-position: right center !important;
    color: #fff !important;
}

.btn-success {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-position 0.5s cubic-bezier(.4,0,.2,1), background 0.5s cubic-bezier(.4,0,.2,1);
    background-size: 200% 100% !important;
    background-position: left center !important;
}
.btn-success:hover, .btn-success:active {
    background-position: right center !important;
    color: #fff !important;
}

/* Results Table */
.results-table {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0;
    margin-top: 0;
    overflow-x: auto;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
}
.results-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
    min-width: 100%;
}
.results-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f4f6;
}
.results-table tbody {
    display: block;
    overflow-y: auto;
    max-height: 65vh;
    width: 100%;
}
.results-table thead, .results-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.results-table th, .results-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f1f1f1;
    white-space: nowrap;
    font-weight: 400;
}
.results-table th {
    background: #f3f4f6;
    color: #222;
    font-size: 1rem;
    font-weight: 600;
}
.results-table tr:last-child td {
    border-bottom: none;
}

/* Results badge */
.results-badge {
    display: inline-block;
    background: #f5f6fa;
    color: #1976d2;
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 1rem;
    margin-left: 18px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* No results message */
.no-results-message {
    text-align: center;
    color: #666;
    font-weight: 500;
    font-size: 1.1rem;
    background: #fff;
    padding: 2.5rem 1.5rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin: 2rem auto 0 auto;
    max-width: 400px;
    box-shadow: none;
}
.no-results-message small {
    color: #aaa;
    font-size: 0.95em;
}

/* Responsive */
@media (max-width: 900px) {
    .main-content {
        max-width: 100vw;
        padding: 0 8px 24px 8px;
    }
    .card-custom {
        padding: 20px 10px 16px 10px;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .results-table {
        max-width: 100vw;
    }
    .d-flex.flex-row.flex-lg-nowrap.align-items-stretch {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
}

/* Autocomplete styles */
.autocomplete-items {
    position: absolute;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(25,118,210,0.10);
    z-index: 1000;
    width: 100%;
    max-width: 320px;
    margin-top: 2px;
    padding: 0.25rem 0;
    border: none;
}
.autocomplete-item {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 1rem;
    color: #222;
    background: none;
    border: none;
    transition: background 0.18s, color 0.18s;
    font-weight: 400;
    border-radius: 6px;
}
.autocomplete-item:hover, .autocomplete-item:active {
    background: #eaf2fd;
    color: #1976d2;
}
.autocomplete-item strong {
    color: #1976d2;
}
.autocomplete-items.empty {
    display: none;
}

.toast-container.position-fixed.top-0.end-0 {
    top: 2rem !important;
    right: 2.5rem !important;
    left: auto !important;
    margin: 0 !important;
}

/* --- Stock Groups UI (stocks.html) --- */
.stock-groups-container {
  width: 70vw;
  margin: 0 auto;
  display: flex;
  gap: 2vw;
  min-height: 70vh;
}
.stock-groups-list-card {
  width: 25vw;
  min-width: 220px;
  max-width: 350px;
  height: 75vh;
  display: flex;
  flex-direction: column;
}
.stock-groups-list-table {
  flex: 1 1 auto;
  overflow-y: auto;
  height: 100%;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fff;
  margin-bottom: 0;
}
.stock-groups-list-table tr {
  cursor: pointer;
  transition: background 0.15s;
}
.stock-groups-list-table tr.selected {
  background: #e6f0fa;
  font-weight: 600;
}
.stock-groups-list-table tr:hover {
  background: #f5f8fa;
}
.stock-group-header {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.stock-group-btn {
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
}
.stock-group-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 1.5rem;
}
#updateGroupBtn, #deleteGroupBtn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 50%;
  width: 50%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.stock-group-right-card {
  width: 45vw;
  min-width: 320px;
  max-width: 700px;
  height: 75vh;
  display: flex;
  flex-direction: column;
}
.stock-group-right-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
#stocksAreaContainer textarea {
  font-family: monospace;
  font-size: 1rem;
  min-height: 300px;
  resize: vertical;
}
/* --- End Stock Groups UI --- */

/* --- Stock Groups Inline Rename Fixes --- */
#editGroupNameInput {
  width: 160px;
  height: 32px;
  font-size: 1.1rem;
  padding: 2px 8px;
  display: inline;
  border: 1.5px solid #1976d2;
  border-radius: 10px;
  color: #222 !important;
  background: #fff !important;
  -webkit-text-fill-color: #222 !important; /* For Chrome/Safari autofill */
  vertical-align: middle;
  outline: none !important;
  box-shadow: none !important;
  font-weight: 600;
  caret-color: #1976d2 !important;
}
#editGroupNameInput::selection {
  background: #b3d4fc !important;
  color: #222 !important;
}
.icon-action.confirm,
.icon-action.confirm > svg,
.fa-check {
  color: #28a745 !important;
  font-weight: bold;
}
.icon-action.confirm:hover,
.icon-action.confirm > svg:hover,
.fa-check:hover {
  color: #28a745 !important;
  filter: none !important;
}
/* Remove filter on hover for icon-action */
.icon-action:hover { filter: none !important; }
/* --- End Stock Groups Inline Rename Fixes --- */

/* --- Stock Groups Inline Rename Icon Color Fixes --- */
.icon-action.confirm {
  color: #28a745 !important;
  font-weight: bold;
}
/* --- End Stock Groups Inline Rename Icon Color Fixes --- */

/* --- Pencil and Action Icon Size/Spacing Fix --- */
#editGroupNameBtn .fa-pencil-alt {
  font-size: 1.2rem;
  background: linear-gradient(90deg, #1976d2 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  color: transparent;
  padding: 0 2px;
  vertical-align: middle;
  cursor: pointer;
  transition: filter 0.15s;
}
#editGroupNameBtn .fa-pencil-alt:hover {
  filter: brightness(1.2);
}
.icon-action {
  font-size: 1.3rem;
  margin-left: 8px;
  margin-right: 0;
  vertical-align: middle;
}
#confirmEditGroupNameBtn {
  margin-left: 8px;
  margin-right: 2px;
}

.pills-container {
  width: 100%;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
}

.stock-groups-list-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 60vh;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding-bottom: 8px;
  margin-top: 0;
  width: 100%;
}
.group-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #222;
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0;
  margin-right: 0;
  cursor: pointer;
  border: none;
  transition: background 0.18s, color 0.18s, border 0.18s;
  text-align: center;
  line-height: 1.2;
}
.group-pill:hover {
  background: linear-gradient(90deg, #1976d2 0%, #764ba2 100%);
  color: #fff;
  border: none;
}
.group-pill.selected {
  background: linear-gradient(90deg, #1976d2 0%, #764ba2 100%);
  color: #fff;
  border: none;
}
.btn-success {
  background: linear-gradient(90deg, #15803d 0%, #166534 100%) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-position 0.5s cubic-bezier(.4,0,.2,1), background 0.5s cubic-bezier(.4,0,.2,1);
  background-size: 200% 100% !important;
  background-position: left center !important;
}
.btn-success:hover, .btn-success:active {
  background-position: right center !important;
  color: #fff !important;
}
#addGroupBtn {
  width: 100%;
  margin-top: 18px;
  margin-bottom: 0;
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 1.08rem;
}

#newGroupNameInput {
  color: #222 !important;
  background: #fff !important;
  -webkit-text-fill-color: #222 !important;
  border: 1.5px solid #1976d2;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 500;
}
#newGroupNameInput::placeholder {
  color: #aaa !important;
  opacity: 1;
}
.text-danger.small {
  display: block;
  margin-top: 2px;
  margin-bottom: 0;
}

.d-none {
  display: none !important;
}

#createGroupContainer .stock-group-actions {
  margin-top: 1.5rem !important;
}
