/* Stock Detail Page Styles */
.stock-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
  min-height: 100vh;
}

/* Stock Header */
.stock-header {
  background: linear-gradient(135deg, #2fc781 0%, #26a66a 100%);
  color: white;
  padding: 40px 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(47, 199, 129, 0.3);
  position: relative;
  overflow: hidden;
}

.stock-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.stock-title h1 {
  font-size: 3rem;
  margin: 0 0 10px 0;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stock-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
}

.stock-price-main {
  text-align: right;
  z-index: 2;
  position: relative;
}

.current-price {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.price-change {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.price-change.positive {
  color: #90ee90;
}

.price-change.negative {
  color: #ffb6c1;
}

.last-updated {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Stock Stats Grid */
.stock-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #2fc781;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: #333;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2fc781;
}

/* Chart Section */
.chart-section {
  background: white;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.chart-header h2 {
  color: #333;
  font-weight: 600;
  margin: 0;
}

.chart-controls {
  display: flex;
  gap: 10px;
}

.chart-btn {
  padding: 8px 16px;
  border: 2px solid #e9ecef;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  color: #666;
}

.chart-btn:hover,
.chart-btn.active {
  background: #2fc781;
  border-color: #2fc781;
  color: white;
}

.chart-container {
  position: relative;
  height: 400px;
  margin-top: 20px;
}

/* Analysis Section */
.analysis-section {
  background: white;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.analysis-section h2 {
  color: #333;
  font-weight: 600;
  margin-bottom: 25px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.analysis-card {
  padding: 25px;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  background: #f8f9fa;
}

.analysis-card h3 {
  color: #2fc781;
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* Price Position */
.position-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.position-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #2fc781 100%);
  transition: width 0.5s ease;
}

.position-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #666;
}

/* Trading Signals */
.trading-signals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal {
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.signal.bullish {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.signal.bearish {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.signal.neutral {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.signal.volume-high {
  background: #cce5ff;
  color: #004085;
  border: 1px solid #b3d7ff;
}

.signal.volume-low {
  background: #f0f0f0;
  color: #495057;
  border: 1px solid #dee2e6;
}

/* Similar Stocks */
.similar-stocks-section {
  background: white;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.similar-stocks-section h2 {
  color: #333;
  font-weight: 600;
  margin-bottom: 25px;
}

.similar-stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.similar-stock-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  text-align: center;
}

.similar-stock-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
  border-color: #2fc781;
  text-decoration: none;
  color: inherit;
}

.similar-symbol {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2fc781;
  margin-bottom: 8px;
}

.similar-price {
  font-weight: 600;
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 5px;
}

.similar-change {
  font-weight: 500;
  font-size: 0.9rem;
}

.similar-change.positive {
  color: #2fc781;
}

.similar-change.negative {
  color: #dc3545;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.action-btn.primary {
  background: #2fc781;
  color: white;
  box-shadow: 0 4px 15px rgba(47, 199, 129, 0.3);
}

.action-btn.primary:hover {
  background: #26a66a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47, 199, 129, 0.4);
  text-decoration: none;
  color: white;
}

.action-btn.secondary {
  background: white;
  color: #2fc781;
  border: 2px solid #2fc781;
}

.action-btn.secondary:hover {
  background: #2fc781;
  color: white;
  transform: translateY(-2px);
}

/* Not Found Section */
.not-found-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px 20px;
}

.not-found-content {
  background: white;
  padding: 50px 40px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 100%;
}

.not-found-content h1 {
  color: #dc3545;
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.not-found-content p {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
}

.suggestions {
  text-align: left;
  margin: 30px 0;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #2fc781;
}

.suggestions h3 {
  color: #2fc781;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.suggestions ul {
  margin: 0 0 20px 20px;
  color: #666;
}

.suggestions li {
  margin-bottom: 8px;
}

.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2fc781;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Animation for page load */
.stock-detail-container > * {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.stock-detail-container > *:nth-child(1) {
  animation-delay: 0.1s;
}
.stock-detail-container > *:nth-child(2) {
  animation-delay: 0.2s;
}
.stock-detail-container > *:nth-child(3) {
  animation-delay: 0.3s;
}
.stock-detail-container > *:nth-child(4) {
  animation-delay: 0.4s;
}
.stock-detail-container > *:nth-child(5) {
  animation-delay: 0.5s;
}
.stock-detail-container > *:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Print Styles */
@media print {
  .stock-detail-container {
    background: white;
    padding: 0;
  }

  .breadcrumbs,
  .quick-actions,
  .chart-controls {
    display: none;
  }

  .stock-header {
    background: #f8f9fa !important;
    color: #333 !important;
    box-shadow: none;
  }

  .chart-container {
    height: 300px;
  }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .stock-detail-container {
    padding: 10px;
  }

  .stock-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 25px 15px;
  }

  .stock-title h1 {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
  }

  .current-price {
    font-size: clamp(2rem, 6vw, 2.5rem);
  }

  .price-change {
    font-size: clamp(1rem, 3vw, 1.2rem);
  }

  .stock-price-main {
    text-align: center;
  }

  .stock-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 15px 10px;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .chart-section,
  .analysis-section,
  .similar-stocks-section {
    padding: 20px 15px;
  }

  .chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .chart-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .chart-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .chart-container {
    height: 250px;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .analysis-card {
    padding: 20px 15px;
  }

  .similar-stocks-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .similar-stock-card {
    padding: 15px 10px;
  }

  .quick-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .action-btn {
    width: 100%;
    max-width: 280px;
    padding: 12px 20px;
  }

  .not-found-content {
    padding: 25px 20px;
    margin: 15px;
  }

  .not-found-content h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .suggestions {
    padding: 20px 15px;
  }

  .action-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .stock-detail-container {
    padding: 8px;
  }

  .breadcrumbs {
    padding: 10px 12px;
    font-size: 12px;
  }

  .stock-header {
    padding: 20px 12px;
  }

  .stock-title h1 {
    font-size: clamp(1.5rem, 4.5vw, 1.8rem);
  }

  .current-price {
    font-size: clamp(1.8rem, 5.5vw, 2rem);
  }

  .price-change {
    font-size: clamp(0.9rem, 2.8vw, 1rem);
  }

  .stock-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 12px 8px;
  }

  .chart-section,
  .analysis-section,
  .similar-stocks-section {
    padding: 15px 10px;
  }

  .chart-container {
    height: 200px;
  }

  .chart-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .analysis-card {
    padding: 15px 10px;
  }

  .similar-stocks-grid {
    grid-template-columns: 1fr;
  }

  .similar-stock-card {
    padding: 12px 8px;
  }

  .action-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .not-found-content {
    padding: 20px 15px;
    margin: 10px;
  }

  .suggestions {
    padding: 15px 10px;
  }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .stock-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .similar-stocks-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .stock-detail-container {
    padding: 25px;
  }

  .stock-header {
    padding: 50px 40px;
  }

  .stock-stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .chart-section,
  .analysis-section,
  .similar-stocks-section {
    padding: 35px 30px;
  }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
  .chart-btn,
  .action-btn,
  .stock-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .similar-stock-card {
    min-height: 80px;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .stock-header {
    background-image: linear-gradient(135deg, #2fc781 0%, #26a66a 100%);
  }
}
