:root {
  --primary-color: #6c5ce7;
  --primary-light: #a29bfe;
  --secondary-color: #00cec9;
  --accent-color: #fdcb6e;
  --success-color: #00b894;
  --danger-color: #d63031;
  --light-bg: #f8f9fd;
  --dark-bg: #1e272e;
  --card-bg-light: #ffffff;
  --card-bg-dark: #2d3436;
  --text-light: #2d3436;
  --text-dark: #dfe6e9;
  --border-light: #e0e0e0;
  --border-dark: #636e72;
  --shadow-light: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-dark: 0 8px 30px rgba(0, 0, 0, 0.3);
  --gradient-light: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
  --gradient-dark: linear-gradient(120deg, #4b6cb7 0%, #182848 100%);
  --transition-speed: 0.3s;
  --card-radius: 16px;
  --button-radius: 8px;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--light-bg);
  color: var(--text-light);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--text-dark);
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

/* Header and logo styles */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode header {
  border-bottom: 1px solid var(--border-dark);
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  height: 50px;
  margin-right: 15px;
}

.logo-icon {
  color: var(--primary-color);
  margin-right: 15px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h1 span {
  font-weight: 300;
}

/* Clock Display */
.clock-container {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.clock-display {
  font-size: 1rem;
  padding: 12px 20px;
  background: var(--card-bg-light);
  border-radius: var(--button-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  border: 1px solid var(--border-light);
  min-width: 300px;
  justify-content: center;
}

.clock-display::before {
  content: "\f017";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 10px;
  color: var(--primary-color);
}

.dark-mode .clock-display {
  background: var(--card-bg-dark);
  border: 1px solid var(--border-dark);
}

/* Control Panel */
.control-panel {
  margin-bottom: 30px;
}

.search-container {
  margin-bottom: 20px;
}

.input-section {
  background: var(--card-bg-light);
  padding: 25px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-light);
  transition: all var(--transition-speed);
}

.dark-mode .input-section {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.input-wrapper {
  position: relative;
  display: flex;
  margin-bottom: 20px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
}

.symbol-input {
  flex-grow: 1;
  padding: 15px 15px 15px 45px;
  font-size: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--button-radius);
  background: var(--light-bg);
  color: var(--text-light);
  transition: all var(--transition-speed);
}

.dark-mode .symbol-input {
  background: var(--dark-bg);
  border: 1px solid var(--border-dark);
  color: var(--text-dark);
}

.symbol-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.symbol-button {
  padding: 0 25px;
  margin-left: 15px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--button-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.symbol-button:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

/* Custom icon styles for quick buttons */
.quick-button img {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  vertical-align: middle;
}

.quick-button:hover img {
  /* Remove the filter that makes icons completely white */
  /* filter: brightness(0) invert(1); */
  /* Instead use a subtle brightness change that keeps the icon visible */
  filter: brightness(1.2);
}

.quick-button {
  flex: 1;
  min-width: 140px;
  padding: 15px;
  background: var(--light-bg);
  color: var(--text-light);
  border: 1px solid var(--border-light);
  border-radius: var(--button-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dark-mode .quick-button {
  background: var(--dark-bg);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
}

.quick-button:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
}

/* Filter Section */
.filter-section {
  background: var(--card-bg-light);
  padding: 20px;
  border-radius: var(--card-radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
  transition: all var(--transition-speed);
}

.dark-mode .filter-section {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.filter-section select {
  padding: 10px 15px;
  border-radius: var(--button-radius);
  border: 1px solid var(--border-light);
  background: var(--light-bg);
  color: var(--text-light);
  font-family: 'Poppins', sans-serif;
  transition: all var(--transition-speed);
  cursor: pointer;
  min-width: 180px;
}

.dark-mode .filter-section select {
  background: var(--dark-bg);
  border: 1px solid var(--border-dark);
  color: var(--text-dark);
}

.filter-section select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--success-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

#filterStatus {
  font-style: italic;
  color: #888;
  text-align: center;
  margin-top: 10px;
  flex-basis: 100%;
}

/* Dashboard Stats - List View */
.dashboard-stats {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 30px;
  background: var(--card-bg-light);
  border-radius: var(--card-radius);
  padding: 15px;
  box-shadow: var(--shadow-light);
}

.dark-mode .dashboard-stats {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.stat-card {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  flex: 0 0 auto;
  margin-right: 20px;
  border-right: 1px solid var(--border-light);
  min-width: 150px;
  background: transparent;
  box-shadow: none;
}

.dark-mode .stat-card {
  border-right: 1px solid var(--border-dark);
}

.stat-card:last-child {
  border-right: none;
  margin-right: 0;
}

.stat-card i {
  font-size: 1.5rem;
  margin-right: 10px;
  color: var(--primary-color);
}

.stat-info span {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0;
  line-height: 1;
}

.stat-info p {
  margin: 0;
  color: #888;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Analysis Cards - Unified size across all views */
.audit-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  grid-auto-flow: dense;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg-light);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  border: none;
  transition: all var(--transition-speed);
  width: 100%;
  height: auto;
  min-height: 280px; /* Ensure minimum height consistency */
  margin: 0;
  cursor: pointer;
}

.dark-mode .card {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.dark-mode .card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Remove unused expand icon styling */
.card .expand-icon {
  display: none;
}

/* Card header with fixed height */
.card-header {
  background: linear-gradient(120deg, var(--primary-light) 0%, var(--primary-color) 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-speed);
  min-height: 60px;
}

.dark-mode .card-header {
  background: linear-gradient(120deg, #4b6cb7 0%, #182848 100%);
}

.card-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  color: white;
}

.card-header h3 span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.8;
  margin-left: 10px;
}

/* Card symbol icon styling */
.card-header h3 img {
  height: 24px;
  width: 24px;
  margin-right: 8px;
  vertical-align: middle;
}

.expand-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: white;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

/* Card summary with fixed height */
.card-summary {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  min-height: 160px;
}

.summary-item {
  background: var(--light-bg);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  box-shadow: none;
  transition: all var(--transition-speed);
}

.dark-mode .summary-item {
  background: var(--dark-bg);
}

.summary-item div:first-child {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 8px;
}

.bullish {
  color: var(--success-color);
  font-weight: 600;
}

.bearish {
  color: var(--danger-color);
  font-weight: 600;
}

/* Add new style for neutral/wait state */
.neutral {
  color: #f39c12; /* Orange color for wait/neutral */
  font-weight: 600;
}

/* Remove unused card expansion functionality */
.card-details {
  display: none;
}

.ai-analysis {
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  background: var(--card-bg-light);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary-color);
  transition: all var(--transition-speed);
}

.dark-mode .ai-analysis {
  background: var(--card-bg-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.ai-analysis p {
  margin: 8px 0;
  font-size: 0.95rem;
}

.ai-analysis p b {
  font-weight: 600;
}

/* Theme Switch */
.theme-switch-wrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  z-index: 100;
  background: var(--card-bg-light);
  padding: 10px 15px;
  border-radius: 30px;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-speed);
}

.dark-mode .theme-switch-wrapper {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.theme-switch {
  display: inline-block;
  height: 26px;
  position: relative;
  width: 50px;
  margin-right: 10px;
}

.theme-switch input {
  display: none;
}

.theme-switch .slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 26px;
}

.theme-switch .slider:before {
  background-color: #fff;
  bottom: 4px;
  content: "";
  height: 18px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 18px;
  border-radius: 50%;
}

.theme-switch input:checked + .slider {
  background-color: var(--primary-color);
}

.theme-switch input:checked + .slider:before {
  transform: translateX(24px);
}

.theme-switch-wrapper em {
  font-style: normal;
  font-size: 0.85rem;
  color: #888;
}

.theme-switch-wrapper i {
  vertical-align: middle;
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(248, 249, 253, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: all var(--transition-speed);
  opacity: 0;
  visibility: hidden;
}

.dark-mode .loader {
  background: rgba(30, 39, 46, 0.9);
}

.loader.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(108, 92, 231, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

.loader p {
  margin-top: 15px;
  color: var(--text-light);
  font-weight: 500;
}

.dark-mode .loader p {
  color: var(--text-dark);
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background: var(--card-bg-light);
  color: #888;
  border-top: 1px solid var(--border-light);
  margin-top: 40px;
  transition: all var(--transition-speed);
}

.dark-mode footer {
  background: var(--card-bg-dark);
  border-top: 1px solid var(--border-dark);
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 992px) {
  .audit-container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  
  .input-wrapper {
    flex-direction: column;
  }
  
  .symbol-input {
    margin-bottom: 15px;
  }
  
  .symbol-button {
    margin-left: 0;
  }
  
  header {
    flex-direction: column;
    text-align: center;
  }
  
  .logo-container {
    margin-bottom: 15px;
    justify-content: center;
  }
  
  .quick-buttons {
    flex-direction: column;
  }
  
  .card-summary {
    grid-template-columns: 1fr;
    padding: 15px 10px;
  }

  .summary-item {
    padding: 10px 5px;
    font-size: 0.9rem;
  }

  .clock-display {
    min-width: auto;
    width: 90%;
    max-width: 300px;
  }
}

/* Responsive adjustments for stats */
@media (max-width: 768px) {
  .audit-container {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .dashboard-stats {
    flex-wrap: wrap;
    padding: 10px;
  }
  
  .stat-card {
    flex: 1 1 calc(50% - 20px);
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
    padding: 10px;
    margin-right: 0;
  }
  
  .dark-mode .stat-card {
    border-bottom: 1px solid var(--border-dark);
  }
  
  .stat-card:nth-child(even) {
    border-left: 1px solid var(--border-light);
  }
  
  .dark-mode .stat-card:nth-child(even) {
    border-left: 1px solid var(--border-dark);
  }
  
  .stat-card:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media (max-width: 576px) {
  .audit-container {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .theme-switch-wrapper {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }
}

@media (max-width: 480px) {
  .stat-card {
    flex: 1 1 100%;
  }
  
  .stat-card:nth-child(even) {
    border-left: none;
  }
  
  .stat-card:nth-last-child(2) {
    border-bottom: 1px solid var(--border-light);
  }
  
  .dark-mode .stat-card:nth-last-child(2) {
    border-bottom: 1px solid var(--border-dark);
  }
}

@media (min-width: 1400px) {
  .audit-container {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .app-container {
    max-width: 1600px;
  }
}

@media (min-width: 1800px) {
  .audit-container {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .app-container {
    max-width: 1800px;
  }
}

@media (min-width: 2200px) {
  .audit-container {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .app-container {
    max-width: 2000px;
  }
}

@media (min-width: 2800px) {
  .audit-container {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: block;
  opacity: 1;
}

.modal-content {
  position: relative;
  background-color: var(--card-bg-light);
  margin: 5% auto;
  padding: 25px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-light);
  width: 80%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.dark-mode .modal-content {
  background-color: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--primary-color);
}

/* Modal Header */
.modal-header {
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .modal-header {
  border-bottom: 1px solid var(--border-dark);
}

.modal-title {
  display: flex;
  align-items: center;
  margin: 0;
  padding-right: 30px;
}

.modal-title i {
  margin-right: 10px;
  color: var(--primary-color);
}

/* Modal title icon styling */
.modal-title img {
  height: 24px;
  width: 24px;
  margin-right: 10px;
  vertical-align: middle;
}

.modal-time {
  margin-top: 5px;
  color: #888;
  font-size: 0.9rem;
}

/* Modal Content Sections */
.modal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.modal-detail-section {
  margin-bottom: 25px;
}

.modal-detail-section h3 {
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.modal-detail-section h3 i {
  margin-right: 10px;
}

/* AI Analysis in modal */
.modal-ai-analysis {
  background: var(--light-bg);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary-color);
}

.dark-mode .modal-ai-analysis {
  background: var(--dark-bg);
}

.modal-ai-analysis-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .modal-ai-analysis-header {
  border-bottom: 1px solid var(--border-dark);
}
