/* =====================================
   UNPROFITABLE PAGE - SCOPED CSS
   ===================================== */

/* Base text visibility - CRITICAL */
.page-unprofitable {
  background-color: #000;
  font-family: 'Courier New', monospace;
  color: #9ca3af; /* Ensure base text is visible */
}

.page-unprofitable * {
  color: inherit; /* Inherit color unless specifically overridden */
}

/* Override Tailwind text colors to ensure visibility */
.page-unprofitable .text-white {
  color: #ffffff !important;
}

.page-unprofitable .text-gray-400 {
  color: #9ca3af !important;
}

.page-unprofitable .text-gray-500 {
  color: #6b7280 !important;
}

.page-unprofitable .text-gray-600 {
  color: #4b5563 !important;
}

.page-unprofitable .text-red-500 {
  color: #ef4444 !important;
}

/* Ensure all text is visible by default */
.page-unprofitable p,
.page-unprofitable h1,
.page-unprofitable h2,
.page-unprofitable h3,
.page-unprofitable h4,
.page-unprofitable h5,
.page-unprofitable h6,
.page-unprofitable span,
.page-unprofitable div,
.page-unprofitable li,
.page-unprofitable a {
  color: #9ca3af;
}

.page-unprofitable .text-white,
.page-unprofitable h1,
.page-unprofitable h2,
.page-unprofitable h3 {
  color: #ffffff !important;
}

/* Custom hover effects */
.page-unprofitable .portfolio-item:hover {
  transform: translateY(-5px);
  transition: transform 0.3s ease;
}

/* Custom animations */
@keyframes unprofitable-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-unprofitable .animate-fadeIn {
  animation: unprofitable-fadeIn 0.5s ease-in-out;
}

/* Custom scrollbar */
.page-unprofitable ::-webkit-scrollbar {
  width: 8px;
}

.page-unprofitable ::-webkit-scrollbar-track {
  background: #111;
}

.page-unprofitable ::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.page-unprofitable ::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* Focus styles for accessibility */
.page-unprofitable a:focus, 
.page-unprofitable button:focus {
  outline: 2px solid #555;
  outline-offset: 2px;
}

/* Trading chart animation */
.page-unprofitable #trading-chart {
  opacity: 0.8;
  min-height: 400px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .page-unprofitable #trading-chart {
    min-height: 300px;
  }
}

.page-unprofitable .chart-line {
  fill: none;
  stroke: #ff0000;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.9));
}

.page-unprofitable .chart-dot {
  fill: #ff3333;
  filter: drop-shadow(0 0 15px rgba(255, 0, 0, 1));
}

@keyframes unprofitable-drawLine {
  from {
    stroke-dashoffset: 2000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes unprofitable-pulsate {
  0% {
    opacity: 0.8;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(255, 0, 0, 1));
  }
  100% {
    opacity: 0.8;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
  }
}

.page-unprofitable .animate-drawLine {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: unprofitable-drawLine 5s forwards ease-out;
}

.page-unprofitable .animate-pulsate {
  animation: unprofitable-pulsate 3s infinite ease-in-out;
}

/* Mobile menu styles */
.page-unprofitable #mobile-menu {
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid #333;
  z-index: 50;
  position: fixed;
  top: calc(1rem + 1rem);
}

/* Adjust the top position of the mobile menu */
.page-unprofitable .fixed.top-\[calc\(1rem\+4rem\)\] {
  top: calc(0.5rem + 2rem);
}

.page-unprofitable .fixed.top-\[calc\(2rem\+4rem\)\] {
  top: calc(0.5rem + 2rem);
}

/* Mobile menu button styles */
.page-unprofitable .mobile-menu-button {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 40px;
  width: 40px;
  cursor: pointer;
  z-index: 51;
}

/* Menu icon styles */
.page-unprofitable #menu-icon, 
.page-unprofitable #close-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Header styles */
.page-unprofitable header {
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  z-index: 45;
  margin-top: 0.5rem;
}

/* Announcement bar styles */
.page-unprofitable .announcement-bar {
  background-color: #ff0000;
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  z-index: 40;
}

.page-unprofitable .announcement-content {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Media query for smaller screens */
@media (max-width: 640px) {
  .page-unprofitable .announcement-bar {
    font-size: 0.55rem;
    padding: 0.4rem 0;
  }
  
  .page-unprofitable .announcement-content {
    padding: 0 0.5rem;
  }
}

.page-unprofitable .announcement-link {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.2s ease;
}

.page-unprofitable .announcement-link:hover {
  opacity: 0.8;
}

/* Modal styles */
.page-unprofitable .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 1rem;
}

.page-unprofitable .modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.page-unprofitable .modal-content {
  background-color: #111;
  border: 1px solid #333;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.page-unprofitable .modal-overlay.active .modal-content {
  transform: translateY(0);
}

.page-unprofitable .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem;
  transition: color 0.3s ease;
  z-index: 1;
}

.page-unprofitable .modal-close:hover {
  color: white;
}

.page-unprofitable .form-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background-color: #222;
  border: 1px solid #444;
  color: white;
  font-family: inherit;
  resize: vertical;
}

.page-unprofitable .form-input:focus {
  outline: none;
  border-color: #666;
}

.page-unprofitable .form-input::placeholder {
  color: #666;
}

.page-unprofitable .form-submit {
  width: 100%;
  background-color: #ff0000;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.page-unprofitable .form-submit:hover {
  background-color: #cc0000;
}

.page-unprofitable .form-submit:disabled {
  background-color: #666;
  cursor: not-allowed;
}

.page-unprofitable .form-success {
  display: none;
  color: #00ff00;
  margin-top: 1rem;
  text-align: center;
  padding: 0.75rem;
  background-color: rgba(0, 255, 0, 0.1);
  border: 1px solid #00ff00;
}

.page-unprofitable .form-error {
  display: none;
  color: #ff0000;
  margin-top: 1rem;
  text-align: center;
  padding: 0.75rem;
  background-color: rgba(255, 0, 0, 0.1);
  border: 1px solid #ff0000;
}

/* Twitter ticker styles */
.page-unprofitable .twitter-ticker-container {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background-color: #111;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  overflow: hidden;
  padding: 0.75rem 0;
  margin-top: -2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
  height: 7.5rem;
}

.page-unprofitable .twitter-ticker-container:hover {
  background-color: #1a1a1a;
}

.page-unprofitable .twitter-ticker-container::before,
.page-unprofitable .twitter-ticker-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 15%;
  z-index: 2;
  pointer-events: none;
}

.page-unprofitable .twitter-ticker-container::before {
  left: 0;
  background: linear-gradient(to right, #111 30%, rgba(17, 17, 17, 0));
}

.page-unprofitable .twitter-ticker-container::after {
  right: 0;
  background: linear-gradient(to left, #111 30%, rgba(17, 17, 17, 0));
}

.page-unprofitable .twitter-ticker-container:hover::before {
  background: linear-gradient(to right, #1a1a1a 30%, rgba(26, 26, 26, 0));
}

.page-unprofitable .twitter-ticker-container:hover::after {
  background: linear-gradient(to left, #1a1a1a 30%, rgba(26, 26, 26, 0));
}

.page-unprofitable .twitter-ticker {
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.page-unprofitable .ticker-row {
  display: flex;
  white-space: nowrap;
  animation: unprofitable-ticker-scroll 20s linear infinite;
  height: 2.5rem;
}

.page-unprofitable .ticker-row:nth-child(2) {
  animation-delay: -6.66s;
  animation-duration: 25s;
}

.page-unprofitable .ticker-row:nth-child(3) {
  animation-delay: -13.33s;
  animation-duration: 22s;
}

.page-unprofitable .twitter-ticker:hover .ticker-row {
  animation-play-state: paused;
}

.page-unprofitable .ticker-item {
  display: inline-block;
  padding: 0 0 0 1.5rem;
  color: #aaa;
  transition: color 0.3s ease;
  font-size: 0.9rem;
  line-height: 2.5;
}

.page-unprofitable .twitter-ticker:hover .ticker-item {
  color: #fff;
}

.page-unprofitable .ticker-item::after {
  content: "•";
  display: inline-block;
  margin-left: 1.5rem;
  color: #ff0000;
}

.page-unprofitable .ticker-item:last-child::after {
  display: none;
}

@keyframes unprofitable-ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@media (min-width: 1280px) {
  .page-unprofitable .twitter-ticker-container {
    height: 8rem;
    padding: 1rem 0;
  }
  
  .page-unprofitable .ticker-row {
    height: 2.6667rem;
  }
  
  .page-unprofitable .ticker-item {
    line-height: 2.6667;
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  .page-unprofitable .twitter-ticker-container {
    height: 5.5rem;
    padding: 0.5rem 0;
    margin-top: -1.5rem;
  }
  
  .page-unprofitable .ticker-row {
    animation-duration: 15s;
    height: 1.85rem;
  }
  
  .page-unprofitable .ticker-row:nth-child(2) {
    animation-duration: 18s;
  }
  
  .page-unprofitable .ticker-row:nth-child(3) {
    animation-duration: 16s;
  }
  
  .page-unprofitable .twitter-ticker-container::before,
  .page-unprofitable .twitter-ticker-container::after {
    width: 20%;
  }
  
  .page-unprofitable .twitter-ticker-container::before {
    background: linear-gradient(to right, #111 40%, rgba(17, 17, 17, 0));
  }
  
  .page-unprofitable .twitter-ticker-container::after {
    background: linear-gradient(to left, #111 40%, rgba(17, 17, 17, 0));
  }
  
  .page-unprofitable .ticker-item {
    font-size: 0.8rem;
    padding: 0 0 0 1rem;
    line-height: 1.85;
  }
  
  .page-unprofitable .ticker-item::after {
    margin-left: 1rem;
  }
}