/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Bootstrap tab-pane visibility fix — Bootstrap 5 removed display:none from .fade:not(.show) */
.tab-pane.fade:not(.show) {
  display: none !important;
}
.tab-pane.fade.show {
  display: block !important;
}

/* Landing styles are included separately via stylesheet_link_tag "landing" */
/* Subscription gate styles are included separately via stylesheet_link_tag "subscription_gate" */

/* Refresh Status Component Styles */
.stocks-section,
.opportunities-section {
  position: relative;
  overflow: visible !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
  height: auto !important;
  max-height: none !important;
}

.refresh-status-component {
  position: relative;
  margin-top: 10px;
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.refresh-status-component .refresh-status-text {
  text-align: right;
}

.refresh-status-component .refresh-status-text .last-refreshed-text {
  color: var(--text-muted, #adb5bd);
  font-size: 0.8rem;
  font-weight: 500;
}

.refresh-status-component .refresh-loading-component {
  background: var(--glass-bg, rgba(0, 0, 0, 0.9));
  border-radius: var(--radius-sm, 6px);
  padding: 6px 10px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--accent-primary-rgb, 0, 212, 170), 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  min-width: 180px;
  transition: all 0.3s ease;
  position: relative;
  display: none;
}

.refresh-status-component .refresh-loading-component.show {
  display: flex !important;
  animation: slideInFromTop 0.3s ease-out;
}

.refresh-status-component .refresh-loading-component .loading-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-spinner {
  flex-shrink: 0;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-spinner .spinner {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(var(--accent-primary-rgb, 0, 212, 170), 0.3);
  border-top: 2px solid var(--accent-primary, #00d4aa);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-animation: spin 1s linear infinite;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-text {
  flex: 1;
  min-width: 0;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-text .loading-message {
  color: var(--accent-primary, #00d4aa);
  font-size: 0.8rem;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-text .loading-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-text .loading-progress .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary, #00d4aa), var(--accent-secondary, #00d4ff));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.refresh-status-component .refresh-loading-component .loading-content .loading-text .loading-progress .progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

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

@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .refresh-status-component {
    top: 5px;
    right: 10px;
  }
  
  .refresh-status-component .refresh-loading-component {
    min-width: 280px;
    padding: 6px 10px;
  }
  
  .refresh-status-component .refresh-loading-component .loading-content {
    gap: 6px;
  }
  
  .refresh-status-component .refresh-loading-component .loading-content .loading-spinner .spinner {
    width: 14px;
    height: 14px;
  }
  
  .refresh-status-component .refresh-loading-component .loading-content .loading-text .loading-message {
    font-size: 0.75rem;
  }
}

/* Navbar Logo Styling */
.navbar-logo {
  width: 4rem;
  height: 4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 212, 170, 0.3));
  transition: all 0.3s ease;
  transform: scale(1.5);
  transform-origin: left center;
}

.navbar-logo:hover {
  transform: scale(1.6);
  filter: drop-shadow(0 4px 8px rgba(0, 212, 170, 0.4));
}

.navbar-brand {
  font-weight: 700;
  font-size: 1rem;
}

/* Mobile adjustments for navbar brand and logo */
@media (max-width: 575px) {
  .navbar-brand {
    font-size: 0.75rem !important;
    max-width: 60%;
  }
  
  .navbar-logo {
    width: 2rem !important;
    height: 2rem !important;
    transform: scale(1.2) !important;
  }
}

/* Modal z-index fixes to ensure they appear above everything */
.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1050 !important;
}

.modal-dialog {
  z-index: 1060 !important;
}

body.webview-mode .cky-btn-revisit-wrapper {
  display: none !important;
}

.cky-btn-revisit-wrapper.cky-revisit-bottom-left {
  bottom: 15px !important;
  left: auto !important;
  right: 15px !important;
}

/* Error pages (404, 500) */
.error-page-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 2rem;
}

.error-page-content {
  text-align: center;
  max-width: 480px;
}

.error-code {
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-primary, #00d4aa), var(--accent-secondary, #00d4ff));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.error-icon {
  color: var(--text-muted, #adb5bd);
  margin-bottom: 1.5rem;
}

.error-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-bottom: 0.75rem;
}

.error-description {
  color: var(--text-muted, #adb5bd);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.btn-error-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary, #00d4aa), var(--accent-secondary, #00d4ff));
  color: #000;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-error-home:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #000;
  text-decoration: none;
}
