/* Trading Academy - Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6b81;
}

/* Selection */
::selection {
    background: #e94560;
    color: white;
}

/* Pattern cards hover effect */
.pattern-card {
    transition: all 0.3s ease;
}

.pattern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(233, 69, 96, 0.15);
}

/* Candle animation */
@keyframes candleGrow {
    from {
        transform: scaleY(0);
        opacity: 0;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.candle-animate {
    animation: candleGrow 0.5s ease-out forwards;
    transform-origin: bottom;
}

/* Gradient text animation */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text-animate {
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
}

/* Pulse animation for entry points */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.pulse-animate {
    animation: pulse 2s ease-in-out infinite;
}

/* Line drawing animation */
@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease-in-out forwards;
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Card entrance animation */
article {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

article:nth-child(1) { animation-delay: 0.1s; }
article:nth-child(2) { animation-delay: 0.2s; }
article:nth-child(3) { animation-delay: 0.3s; }
article:nth-child(4) { animation-delay: 0.4s; }
article:nth-child(5) { animation-delay: 0.5s; }

/* Quiz button states */
.quiz-btn.correct {
    background: rgba(0, 210, 106, 0.3) !important;
    border: 2px solid #00d26a;
}

.quiz-btn.incorrect {
    background: rgba(233, 69, 96, 0.3) !important;
    border: 2px solid #e94560;
}

/* Input focus styles */
input:focus {
    border-color: #e94560 !important;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

/* Table styles */
table {
    border-collapse: collapse;
}

table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* SVG responsive */
svg {
    max-width: 100%;
    height: auto;
}

/* Mobile menu animation */
#mobileMenu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobileMenu.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Navigation link underline effect */
nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e94560;
    transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Button hover effects */
button, a[class*="bg-gold"] {
    position: relative;
    overflow: hidden;
}

button::before, a[class*="bg-gold"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

button:hover::before, a[class*="bg-gold"]:hover::before {
    left: 100%;
}

/* Lesson number badges */
.lesson-badge {
    position: relative;
}

.lesson-badge::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #e94560, #ff6b81);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lesson-badge:hover::after {
    opacity: 1;
}

/* Glow effect for important elements */
.glow {
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
}

/* Chart container styles */
.chart-container {
    position: relative;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.5) 0%, rgba(22, 33, 62, 0.8) 100%);
    border-radius: 1rem;
    padding: 1rem;
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1a1a2e;
    border: 1px solid #e94560;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

/* Progress indicator */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #ff6b81);
    transition: width 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    svg {
        max-height: 200px;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th, table td {
        padding: 0.5rem !important;
    }
}

/* Print styles */
@media print {
    header, footer, nav {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-secondary\/50, .bg-accent\/30 {
        background: #f5f5f5 !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    /* Already dark theme, but can add specific adjustments */
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
