/* DarkMatter Marketplace - Complete Stylesheet */

/* Force Dark Theme - Override system preferences */
html {
    color-scheme: dark !important;
}

/* CSS Variables */
:root {
    --dark-bg: #0a0a0f;
    --dark-secondary: #121218;
    --accent-blue: #0072ff;
    --accent-blue-dark: #0058cc;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #333333;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #0072ff 0%, #0058cc 100%);
    --gradient-dark: linear-gradient(135deg, #0a0a0f 0%, #121218 100%);
    --shadow-glow: 0 0 20px rgba(0, 114, 255, 0.3);
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 25px rgba(0, 114, 255, 0.2);
}

/* Reset and Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto Mono', monospace;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Glow Effects */
.glow {
    text-shadow: 0 0 10px var(--accent-blue), 0 0 20px var(--accent-blue), 0 0 30px var(--accent-blue);
    animation: glow-pulse 2s ease-in-out infinite alternate;
    will-change: text-shadow;
}

@keyframes glow-pulse {
    from {
        text-shadow: 0 0 10px var(--accent-blue), 0 0 20px var(--accent-blue), 0 0 30px var(--accent-blue);
    }
    to {
        text-shadow: 0 0 20px var(--accent-blue), 0 0 30px var(--accent-blue), 0 0 40px var(--accent-blue);
    }
}

.glow-box {
    box-shadow: 0 0 10px var(--accent-blue), 0 0 20px rgba(0, 114, 255, 0.3);
    will-change: box-shadow;
}

/* Background Effects */
.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.matrix-bg span {
    position: absolute;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--accent-blue);
    opacity: 0.7;
    animation: matrix-fall linear infinite;
    user-select: none;
}

@keyframes matrix-fall {
    0% {
        transform: translateY(-100%);
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(1000px);
        opacity: 0;
    }
}

/* Particles Background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Animations */
.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-in-out forwards;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

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

/* Prevent animation from repeating */
.animation-completed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out;
}

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

/* Crypto Ticker */
.crypto-ticker {
    background: linear-gradient(90deg, rgba(0,114,255,0.1) 0%, rgba(0,114,255,0.2) 100%);
    border-bottom: 1px solid var(--accent-blue);
    overflow: hidden;
}

/* Crypto ticker is now static - no animation needed */

/* Navigation */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent-blue) !important;
}

/* Ensure navigation is visible */
header .hidden.md\\:flex {
    display: none;
}

@media (min-width: 768px) {
    header .hidden.md\\:flex {
        display: flex !important;
    }
}

/* Force navigation visibility */
.nav-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 767px) {
    .nav-container {
        display: none;
    }
    
    /* Mobile navigation improvements */
    .mobile-menu {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        z-index: 50;
        padding: 2rem;
    }
    
    .mobile-menu.hidden {
        display: none !important;
    }
    
    .mobile-menu .nav-link {
        font-size: 1.5rem;
        padding: 1rem 2rem;
        margin: 0.5rem 0;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.3s ease;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-menu .nav-link:hover {
        background: rgba(0, 114, 255, 0.2);
        border-color: var(--accent-blue);
        transform: scale(1.05);
    }
}

/* Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    will-change: transform, box-shadow;
    contain: layout style paint;
    /* Prevent initial flash */
    opacity: 0;
    transform: translateY(20px);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Category Cards */
.category-card {
    background: var(--dark-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    /* Prevent initial flash */
    opacity: 0;
    transform: translateY(20px);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.category-image {
    height: 200px;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-content {
    padding: 1.5rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.category-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-count {
    font-size: 0.75rem;
    color: var(--accent-blue);
    font-weight: 500;
}

.category-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.category-link:hover {
    color: var(--accent-blue);
}

/* Featured Cards */
.featured-card {
    background: var(--dark-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

/* News Cards */
.news-card {
    background: var(--dark-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
    /* Prevent initial flash */
    opacity: 0;
    transform: translateY(20px);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.news-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* FAQ Search */
.faq-search-container {
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.faq-search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--dark-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    min-height: 56px;
}

.faq-search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 114, 255, 0.1);
    background: var(--dark-bg);
}

.faq-search-input::placeholder {
    color: var(--text-muted);
}

.faq-search-results {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: none;
}

.faq-search-results.show {
    display: block;
}

.faq-search-count {
    color: var(--accent-blue);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.faq-no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* FAQ Items */
.faq-item {
    background: var(--dark-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    /* Prevent initial flash */
    opacity: 0;
    transform: translateY(20px);
}

.faq-item:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-card);
}

.faq-item.hidden {
    display: none;
}

.faq-item.highlighted {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 114, 255, 0.3);
    background: rgba(0, 114, 255, 0.05);
}

.faq-question {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: rgba(0, 114, 255, 0.1);
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1rem 1rem;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Link Items */
.link-item {
    background: var(--dark-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    /* Prevent initial flash */
    opacity: 0;
    transform: translateY(20px);
}

.link-item:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-card);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.link-url {
    font-family: 'Roboto Mono', monospace;
    color: var(--text-primary);
    word-break: break-all;
    font-size: 0.875rem;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: rgba(0, 114, 255, 0.1);
    color: var(--text-primary);
}

.link-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.status-primary {
    background-color: var(--success-color);
    color: white;
}

.status-mirror {
    background-color: var(--accent-blue);
    color: white;
}

.status-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* PGP Section */
.pgp-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pgp-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.pgp-key {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Typing Effect */
.typing-effect::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--accent-blue);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Mobile Menu */
.mobile-menu {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .mobile-menu {
        transform: translateX(0);
    }
    
    /* Touch-friendly mobile menu */
    .mobile-menu .nav-link {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Improved mobile menu animations */
    .mobile-menu {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.9);
    }
    
    .mobile-menu:not(.hidden) {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
}

/* Breadcrumbs */
.breadcrumb-container {
    background: var(--dark-secondary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
}

/* Touch-optimized button sizes */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Specific button optimizations */
    .browse-btn {
        min-height: 48px;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    .copy-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    /* FAQ question buttons */
    .faq-question {
        min-height: 60px;
        padding: 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Mobile menu button */
    #mobileMenuBtn {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem;
    }
    
    /* Close mobile menu button */
    #closeMobileMenu {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem;
    }
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-card);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--dark-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Form Elements */
.form-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 114, 255, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue-dark);
}

/* Touch Interface Improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for touch */
    .space-y-4 > * + * {
        margin-top: 1.5rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 2rem;
    }
    
    /* Improved card interactions */
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Better form inputs */
    .form-input {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
    }
    
    /* FAQ improvements */
    .faq-item {
        margin-bottom: 1.5rem;
    }
    
    .faq-question {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Link improvements */
    .link-item {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Better button spacing */
    .flex.space-x-4 > * + * {
        margin-left: 1rem;
    }
    
    .flex.space-y-4 > * + * {
        margin-top: 1rem;
    }
    
    /* Hero section mobile improvements */
    .hero-section .md\:w-1\/2:last-child {
        margin-left: 0.5rem;
        margin-right: -0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Main hero image positioning for better symmetry */
    .hero-section .md\:w-1\/2:last-child img {
        transform: translateX(0.25rem);
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Better mobile image positioning */
    .hero-section .flex.justify-center {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Additional mobile image adjustments */
@media (max-width: 640px) {
    .hero-section .md\:w-1\/2:last-child {
        margin-left: 0.75rem;
        margin-right: -0.75rem;
    }
    
    .hero-section .md\:w-1\/2:last-child img {
        transform: translateX(0.5rem);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .category-image {
        height: 150px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .crypto-ticker .animate-marquee {
        animation: marquee 20s linear infinite;
    }
}

@media (max-width: 640px) {
    .matrix-bg {
        overflow: hidden !important;
    }
    
    .crypto-ticker .animate-marquee {
        animation: marquee 25s linear infinite;
    }
    
    .category-content {
        padding: 1rem;
    }
    
    .link-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .link-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Print Styles */
@media print {
    .matrix-bg,
    #particles-js,
    .crypto-ticker,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card,
    .category-card,
    .news-card,
    .faq-item {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #666666;
    }
    
    .card,
    .category-card,
    .news-card,
    .faq-item {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .matrix-bg span {
        animation: none;
    }
    
    .crypto-ticker .animate-marquee {
        animation: none;
    }
}

/* Dark Mode (already default, but explicit) */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-bg: #0a0a0f;
        --dark-secondary: #121218;
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
    }
}

/* Force Dark Mode - Override system preferences */
@media (prefers-color-scheme: light) {
    :root {
        --dark-bg: #0a0a0f !important;
        --dark-secondary: #121218 !important;
        --text-primary: #e0e0e0 !important;
        --text-secondary: #a0a0a0 !important;
        --border-color: #333333 !important;
    }
    
    .matrix-bg span {
        color: var(--accent-blue) !important;
    }
    
    /* Ensure all elements maintain dark theme */
    body {
        background-color: var(--dark-bg) !important;
        color: var(--text-primary) !important;
    }
    
    .card, .category-card, .news-card, .faq-item, .link-item {
        background: var(--dark-secondary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .bg-gray-900, .bg-gray-800 {
        background-color: var(--dark-secondary) !important;
    }
    
    .text-gray-400, .text-gray-300, .text-gray-500 {
        color: var(--text-secondary) !important;
    }
    
    .text-white {
        color: var(--text-primary) !important;
    }
    
    /* Additional overrides for specific elements */
    .bg-gray-700 {
        background-color: var(--dark-bg) !important;
    }
    
    .border-gray-700, .border-gray-800 {
        border-color: var(--border-color) !important;
    }
    
    .text-gray-600 {
        color: var(--text-muted) !important;
    }
    
    /* Ensure form elements maintain dark theme */
    .form-input, .faq-search-input {
        background: var(--dark-secondary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .form-input:focus, .faq-search-input:focus {
        background: var(--dark-bg) !important;
        border-color: var(--accent-blue) !important;
    }
    
    /* Ensure buttons maintain proper contrast */
    .btn-secondary {
        background: var(--dark-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    .btn-secondary:hover {
        background: var(--accent-blue) !important;
        border-color: var(--accent-blue) !important;
        color: white !important;
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Remove focus outline for navigation links */
.nav-link:focus {
    outline: none;
    box-shadow: none;
}

.nav-link:active {
    outline: none;
    box-shadow: none;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Hide skip-link on mobile devices */
@media (max-width: 768px) {
    .skip-link {
        display: none !important;
    }
}

/* Image Optimizations */
img {
    max-width: 100%;
    height: auto;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Animation Delays */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-500 {
    animation-delay: 0.5s;
}

/* Hover Effects */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
    transition: box-shadow 0.3s ease;
}

/* Custom Scrollbar for Specific Elements */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--dark-bg);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success/Error States */
.success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.error {
    color: var(--error-color);
    border-color: var(--error-color);
}

.warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

/* ========================================
   ADVANCED ANIMATIONS & EFFECTS
   ======================================== */

/* Advanced Glow Effects */
.glow-text {
    background: linear-gradient(45deg, #0072ff, #00d4ff, #0072ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glow-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(45deg, #0a0a0f, #121218) padding-box,
                linear-gradient(45deg, #0072ff, #00d4ff, #0072ff) border-box;
    animation: border-glow 2s ease-in-out infinite alternate;
}

@keyframes border-glow {
    from { 
        box-shadow: 0 0 10px rgba(0, 114, 255, 0.3),
                   0 0 20px rgba(0, 114, 255, 0.2),
                   0 0 30px rgba(0, 114, 255, 0.1);
    }
    to { 
        box-shadow: 0 0 20px rgba(0, 114, 255, 0.5),
                   0 0 40px rgba(0, 114, 255, 0.3),
                   0 0 60px rgba(0, 114, 255, 0.2);
    }
}

/* Floating Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Pulse Animation */
.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 114, 255, 0.3),
                   0 0 10px rgba(0, 114, 255, 0.2),
                   0 0 15px rgba(0, 114, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(0, 114, 255, 0.5),
                   0 0 20px rgba(0, 114, 255, 0.3),
                   0 0 30px rgba(0, 114, 255, 0.2);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Bounce Animation */
.bounce-in {
    animation: bounce-in 0.6s ease-out;
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
.slide-in-left {
    animation: slide-in-left 0.5s ease-out;
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slide-in-right 0.5s ease-out;
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes slide-in-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rotate Animations */
.rotate-in {
    animation: rotate-in 0.6s ease-out;
}

@keyframes rotate-in {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Scale Animations */
.scale-in {
    animation: scale-in 0.4s ease-out;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover Effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-tilt {
    transition: transform 0.3s ease;
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

/* Loading Animations */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 114, 255, 0.3);
    border-top: 4px solid #0072ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress Bar Animation */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 114, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0072ff, #00d4ff);
    border-radius: 2px;
    animation: progress-fill 2s ease-in-out;
}

@keyframes progress-fill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Matrix Rain Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.matrix-rain span {
    position: absolute;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: #0072ff;
    opacity: 0.8;
    animation: matrix-fall 10s linear infinite;
    user-select: none;
}

@keyframes matrix-fall {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Particle Effects */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #0072ff;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 8s linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch 0.3s ease-in-out infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s ease-in-out infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s ease-in-out infinite;
    color: #00ff00;
    z-index: -2;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(-2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* Neon Text Effect */
.neon-text {
    color: #0072ff;
    text-shadow: 0 0 5px #0072ff,
                 0 0 10px #0072ff,
                 0 0 15px #0072ff,
                 0 0 20px #0072ff,
                 0 0 35px #0072ff,
                 0 0 40px #0072ff;
    animation: neon-flicker 2s infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 0 0 5px #0072ff,
                     0 0 10px #0072ff,
                     0 0 15px #0072ff,
                     0 0 20px #0072ff,
                     0 0 35px #0072ff,
                     0 0 40px #0072ff;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Morphing Background */
.morphing-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #0a0a0f, #121218, #0a0a0f);
    background-size: 400% 400%;
    animation: morphing-gradient 15s ease infinite;
    z-index: -1;
}

@keyframes morphing-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(45deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographic-shift 3s ease infinite;
}

@keyframes holographic-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 3D Card Effect */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(10deg);
}

.card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 114, 255, 0.1), transparent);
    transform: translateZ(-1px);
    opacity: 0;
    transition: opacity 0.6s;
}

.card-3d:hover::before {
    opacity: 1;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .float {
        animation-duration: 4s;
    }
    
    .glow-text {
        animation-duration: 2s;
    }
    
    .matrix-rain span {
        font-size: 12px;
    }
}

/* Reduced Motion Support for Animations */
@media (prefers-reduced-motion: reduce) {
    .float,
    .glow-text,
    .pulse-glow,
    .bounce-in,
    .slide-in-left,
    .slide-in-right,
    .slide-in-up,
    .rotate-in,
    .scale-in,
    .loading-spinner,
    .progress-fill,
    .matrix-rain span,
    .particle,
    .glitch,
    .neon-text,
    .morphing-bg,
    .holographic {
        animation: none !important;
    }
    
    .hover-scale:hover,
    .hover-rotate:hover,
    .hover-tilt:hover {
        transform: none !important;
    }
}

/* High Performance Animations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-500 { animation-delay: 0.5s; }
.delay-700 { animation-delay: 0.7s; }
.delay-1000 { animation-delay: 1s; }

/* Staggered Animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ========================================
   SCROLL ANIMATION FIXES
   ======================================== */

/* Ensure elements are visible after animation */
.animate-fade-in,
.animation-completed {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* Prevent elements from disappearing during scroll */
.card,
.category-card,
.news-card,
.faq-item,
.link-item {
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth transitions for better UX */
.card,
.category-card,
.news-card,
.faq-item,
.link-item {
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out, box-shadow 0.3s ease;
}

/* Ensure hover effects work properly after animation */
.card:hover,
.category-card:hover,
.news-card:hover {
    transform: translateY(-5px) !important;
}

/* Fix for mobile devices */
@media (max-width: 768px) {
    .card,
    .category-card,
    .news-card,
    .faq-item,
    .link-item {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Reduced motion support for scroll fixes */
@media (prefers-reduced-motion: reduce) {
    .card,
    .category-card,
    .news-card,
    .faq-item,
    .link-item {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }
    
    .animate-fade-in {
        animation: none !important;
    }
}
