/* Custom styles for Covered Warrants website */

/* Google Font Integration */
.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* Navbar active link styling */
nav a.active {
    color: #166534;
    background-color: #f0fdf4;
    font-weight: 600;
}

/* Grid pattern background */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Custom animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

/* Smooth hover transitions for cards */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #166534 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #166534, #f59e0b);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #14532d, #d97706);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Navbar backdrop blur enhancement */
nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Section spacing */
section {
    scroll-margin-top: 128px; /* Account for full navbar (80px nav + 48px ticker) */
}

/* Hero section spacing - account for fixed navbar (80px) + ticker height (48px) */
#home {
    padding-top: 128px; /* 80px navbar + 48px ticker = 128px */
}

/* Navbar total height adjustment */
nav {
    min-height: 128px; /* 80px nav bar + 48px ticker */
}

/* Enhanced focus states for accessibility */
a:focus,
button:focus {
    outline: 2px solid #166534;
    outline-offset: 2px;
}

/* Professional card shadows */
.card-shadow {
    box-shadow: 
        0 1px 3px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.card-shadow-lg {
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Typography enhancements */
.text-balance {
    text-wrap: balance;
}

/* Responsive image containers */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

/* Professional button styles */
.btn-primary {
    background: linear-gradient(135deg, #166534 0%, #f59e0b 100%);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #14532d 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(22, 101, 52, 0.3);
}

/* Section dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(148, 163, 184, 0.3), transparent);
    margin: 3rem 0;
}

/* Dropdown menu animations */
#tools-dropdown-menu,
#phs-dropdown-menu,
#language-dropdown-menu {
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown arrow transition */
#tools-dropdown-arrow,
#mobile-tools-dropdown-arrow,
#phs-dropdown-arrow,
#mobile-phs-dropdown-arrow,
#language-dropdown-arrow,
#mobile-language-dropdown-arrow {
    transition: transform 0.2s ease-out;
}

/* Dropdown menu hover states */
#tools-dropdown-menu a:hover,
#education-dropdown-menu a:hover,
#phs-dropdown-menu a:hover,
#language-dropdown-menu button:hover {
    background-color: #f0fdf4;
}

/* Education tab styling */
.education-tab-btn {
    transition: all 0.2s ease-out;
}

.education-tab-btn.active {
    background: linear-gradient(135deg, #166534 0%, #14532d 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(22, 101, 52, 0.3);
}

.education-tab-btn:not(.active):hover {
    background-color: #f0fdf4;
    color: #166534;
}

/* Education dropdown animations */
#education-dropdown-menu {
    animation: fadeInDown 0.2s ease-out;
}

/* Education dropdown arrow transition */
#education-dropdown-arrow,
#mobile-education-dropdown-arrow {
    transition: transform 0.2s ease-out;
}

/* Stock Ticker Styles - Integrated in Navbar */
.stock-ticker-section {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    height: 48px; /* Fixed height for ticker */
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #f8fafc, #ffffff, #f8fafc);
}

.stock-ticker-loading {
    display: flex;
    align-items: center;
    height: 48px;
    font-size: 0.875rem;
}

.stock-ticker-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.stock-ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    width: max-content;
    animation: scroll-left 60s linear infinite;
    will-change: transform;
}

.stock-ticker-track:hover {
    animation-play-state: paused;
}

.stock-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    flex-shrink: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.stock-symbol {
    color: #0f172a; /* slate-900 */
    font-weight: 700;
    min-width: 3rem;
}

.stock-price {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.stock-change {
    font-weight: 600;
    font-size: 0.8125rem;
}

.stock-ticker-separator {
    color: rgba(15, 23, 42, 0.3); /* slate-900 with opacity */
    font-weight: 300;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

@keyframes scroll-left {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Responsive adjustments for stock ticker */
@media (max-width: 768px) {
    .stock-ticker-item {
        padding: 0 1rem;
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    
    .stock-symbol {
        min-width: 2.5rem;
    }
    
    .stock-price {
        font-size: 0.75rem;
    }
    
    .stock-change {
        font-size: 0.6875rem;
    }
    
    .stock-ticker-track {
        animation-duration: 45s;
    }
}

/* Hero Carousel Styles */
.hero-carousel-container {
    position: relative;
}

.hero-carousel-wrapper {
    position: relative;
    width: 100%;
    height: 650px;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    visibility: hidden;
    z-index: 1;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

.hero-slide.active {
    position: absolute;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    visibility: visible;
    z-index: 2;
    height: 100%;
}

.hero-slide .fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s, 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hero-slide.active .fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure smooth transitions when slides change */
.hero-slide:not(.active) .fade-in {
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
    opacity: 0;
    transform: translateY(30px);
}

/* Hero Navigation Dots */
.hero-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-dot.active {
    opacity: 1 !important;
    transform: scale(1.2);
}

/* Hero Navigation Arrows */
.hero-nav-btn {
    cursor: pointer;
}

.hero-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Responsive adjustments for hero carousel */
@media (max-width: 768px) {
    .hero-nav-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .hero-nav-btn.hero-prev {
        left: 0.5rem;
    }
    
    .hero-nav-btn.hero-next {
        right: 0.5rem;
    }
    
    .hero-carousel-wrapper {
        height: 550px;
    }
}

@media (max-width: 640px) {
    .hero-nav-btn {
        display: none; /* Hide arrows on very small screens for cleaner look */
    }
}

/* Article Carousel Styles (Similar to Hero Carousel) */
.article-carousel-container {
    position: relative;
}

.article-carousel-wrapper {
    position: relative;
    width: 100%;
}

.article-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    visibility: hidden;
    z-index: 1;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.article-carousel-slide.active {
    position: relative;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    visibility: visible;
    z-index: 2;
}

.article-carousel-slide .fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s, 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.article-carousel-slide.active .fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure smooth transitions when slides change */
.article-carousel-slide:not(.active) .fade-in {
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
    opacity: 0;
    transform: translateY(30px);
}

/* Article Navigation Dots */
.article-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.article-dot.active {
    opacity: 1 !important;
    transform: scale(1.2);
}

/* Article Navigation Arrows */
.article-carousel-prev,
.article-carousel-next {
    cursor: pointer;
}

.article-carousel-prev:hover,
.article-carousel-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Responsive adjustments for article carousel */
@media (max-width: 768px) {
    .article-carousel-prev,
    .article-carousel-next {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .article-carousel-prev {
        left: 0.5rem;
    }
    
    .article-carousel-next {
        right: 0.5rem;
    }
}

@media (max-width: 640px) {
    .article-carousel-prev,
    .article-carousel-next {
        display: none; /* Hide arrows on very small screens for cleaner look */
    }
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.scroll-to-top-btn.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.scroll-to-top-btn:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1) !important;
}

.scroll-to-top-btn:active {
    transform: translateY(-1px);
}

/* Responsive adjustments for scroll to top button */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        width: 2.25rem;
        height: 2.25rem;
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem;
    }
    
    .scroll-to-top-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

/* Custom scrollbar for checkbox containers - normal color */
.checkbox-container::-webkit-scrollbar {
    width: 8px;
}

.checkbox-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.checkbox-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.checkbox-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* For Firefox */
.checkbox-container {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Article Page Styles */
.article-prose {
    color: #334155;
    line-height: 1.75;
}

/* Prose typography for article content */
.prose {
    color: #334155;
}

.prose p {
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.prose ul,
.prose ol {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose strong {
    font-weight: 600;
    color: #0f172a;
}

.prose a {
    color: #166534;
    text-decoration: underline;
}

.prose a:hover {
    color: #14532d;
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: block;
    width: 100%;
}

.tooltip-icon {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    cursor: help;
    color: #64748b;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.tooltip-icon:hover {
    color: #166534;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    transform: translateY(-4px);
    padding: 8px 12px;
    background-color: #1e293b;
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 6px;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    max-width: 250px;
    text-align: left;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.tooltip-container:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Ensure tooltips can escape table boundaries and appear above container */
table th .tooltip-container,
table td .tooltip-container {
    overflow: visible;
}

table th,
table td {
    overflow: visible !important;
    position: relative;
}

/* Allow tooltips to escape overflow containers */
.overflow-x-auto {
    overflow-y: visible !important;
}

/* Ensure tooltip positioning works correctly in table headers */
table th .tooltip-container {
    position: relative;
    z-index: 1;
}

table th .tooltip-container:hover {
    z-index: 10001;
}

/* Fix for table header tooltips - ensure they appear above */
table thead {
    position: relative;
    z-index: 1;
}

table thead th {
    position: relative;
    padding-top: 3rem !important;
}

/* Specific fix for price simulator table tooltips */
#price-simulator-content {
    position: relative;
    overflow: visible;
}

#price-simulator-content .overflow-x-auto {
    overflow-y: visible !important;
    overflow-x: auto;
    position: relative;
}

#price-simulator-content table {
    position: relative;
}

#price-simulator-content table thead {
    position: relative;
    z-index: 10;
}

#price-simulator-content table thead th {
    padding-top: 3.5rem !important;
}

/* Flag emoji rendering improvements for cross-platform compatibility */
#current-language-flag,
#mobile-current-language-flag,
.lang-option .text-lg,
.mobile-lang-option .text-lg {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Twemoji Mozilla", "EmojiOne", "Android Emoji", sans-serif;
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    /* Ensure flags render as single characters */
    unicode-bidi: isolate;
    direction: ltr;
    /* Prevent text fallback on systems without emoji support */
    font-feature-settings: "liga" off;
    /* Force emoji rendering */
    font-variant-emoji: emoji;
}

/* Fallback for systems that don't support flag emojis */
@supports not (font-variant-emoji: emoji) {
    #current-language-flag,
    #mobile-current-language-flag,
    .lang-option .text-lg,
    .mobile-lang-option .text-lg {
        /* Try to use system emoji fonts */
        font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    }
}

/* Technical Analysis Gauge Styles */
.technical-gauge-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.technical-gauge {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.technical-gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-segment {
    transition: all 0.3s ease;
}

.gauge-segment-sell {
    fill: #dc2626; /* Red for Sell */
}

.gauge-segment-neutral {
    fill: #fca5a5; /* Light red/pink for Neutral */
}

.gauge-segment-buy {
    fill: #fbbf24; /* Yellow for Buy */
}

.gauge-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.gauge-needle-line {
    stroke: #1e40af; /* Dark blue for needle */
    stroke-width: 3;
    stroke-linecap: round;
}

.gauge-needle-circle {
    fill: #1e40af; /* Dark blue for needle center */
}

.gauge-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e40af; /* Dark blue for signal text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    margin: 0.5rem 0;
}

.gauge-summary {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #1e40af; /* Dark blue for text */
}

.gauge-summary-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.gauge-summary-count {
    font-weight: 700;
    color: #1e40af; /* Dark blue for numbers */
}

/* Modal animations */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}
