/* Custom Styles for Codens Landing Page */

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

/* Apply animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

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

/* Gradient text animation */
.gradient-text-animated {
    background: linear-gradient(135deg, #DC2626, #2563EB, #059669, #EAB308);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

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

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

/* Mobile menu transition */
#mobile-menu {
    transition: max-height 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 500px;
}

/* Sticky navigation shadow on scroll */
nav.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Product card hover effects */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
}

/* Feature icon animation */
.feature-icon {
    transition: transform 0.3s ease;
}

.feature-icon:hover {
    transform: scale(1.1);
}

/* Comparison table hover effect */
table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #f9fafb;
}

/* Smooth color transitions */
a, button {
    transition: all 0.2s ease;
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

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

/* Integration icons hover */
.integration-icon {
    transition: transform 0.3s ease;
}

.integration-icon:hover {
    transform: translateY(-5px);
}

/* Gradient button animation */
.gradient-btn {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

/* Hero section floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Product icons hover effects */
.product-icon-wrapper {
    transition: all 0.3s ease;
}

.product-icon-wrapper:hover {
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    table {
        font-size: 0.875rem;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav,
    footer,
    .no-print {
        display: none;
    }

    body {
        background: white;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip styling */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Language switcher */
.lang-switcher {
    position: relative;
}

.lang-switcher::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #DC2626, #2563EB, #059669);
    transition: width 0.3s ease;
}

.lang-switcher:hover::after {
    width: 100%;
}

/* Prevent any element from causing horizontal viewport overflow (safety net for fixed nav width) */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Help-page tables: keep layout on desktop, fall back to horizontal scroll on mobile so they don't push the page wider than the viewport */
@media (max-width: 768px) {
    .help-table,
    .help-tools-table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .help-code {
        max-width: 100%;
        overflow-x: auto;
    }
}
