/* 
 * All Calculators Page Styles
 * This file contains custom styles for the All Calculators page template
 */

/* Hero section styles */
.all-calculators-hub .hero-section {
    position: relative;
    overflow: hidden;
    padding-bottom: 6rem; /* Space for the wave */
}

/* Calculator Animation in Hero */
.calculator-animation {
    position: relative;
    z-index: 1;
}

.calculator-device {
    transition: all 0.5s ease;
    will-change: transform;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.calculator-screen {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.calc-key {
    transition: all 0.15s ease;
    user-select: none;
}

.calc-key:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.calc-key:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* Hero Buttons */
.btn-hero-primary {
    transition: all 0.3s ease;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
}

.btn-hero-secondary {
    transition: all 0.3s ease;
}

.btn-hero-secondary:hover {
    transform: translateY(-2px);
}

/* Animation Keyframes */
@keyframes float {
    0% { transform: translateY(0px) rotate(6deg); }
    50% { transform: translateY(-10px) rotate(6deg); }
    100% { transform: translateY(0px) rotate(6deg); }
}

@keyframes float-delay {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes float-slow {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Animation Classes */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.animate-float-delay {
    animation: float-delay 5s ease-in-out 1s infinite;
}

.animate-bounce-slow {
    animation: bounce-slow 5s ease-in-out infinite;
}

/* Animated calculator symbols in background */
.calculator-symbols {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.calculator-symbols .symbol {
    position: absolute;
    color: rgba(255, 255, 255, 0.2);
    font-size: 3rem;
    font-weight: bold;
    animation-name: float-around;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.calculator-symbols .symbol:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-duration: 15s;
}

.calculator-symbols .symbol:nth-child(2) {
    top: 20%;
    left: 25%;
    animation-duration: 18s;
}

.calculator-symbols .symbol:nth-child(3) {
    top: 15%;
    left: 50%;
    animation-duration: 20s;
}

.calculator-symbols .symbol:nth-child(4) {
    top: 25%;
    left: 70%;
    animation-duration: 17s;
}

.calculator-symbols .symbol:nth-child(5) {
    top: 40%;
    left: 85%;
    animation-duration: 19s;
}

.calculator-symbols .symbol:nth-child(6) {
    top: 60%;
    left: 80%;
    animation-duration: 16s;
}

.calculator-symbols .symbol:nth-child(7) {
    top: 70%;
    left: 65%;
    animation-duration: 21s;
}

.calculator-symbols .symbol:nth-child(8) {
    top: 80%;
    left: 40%;
    animation-duration: 14s;
}

.calculator-symbols .symbol:nth-child(9) {
    top: 75%;
    left: 20%;
    animation-duration: 22s;
}

.calculator-symbols .symbol:nth-child(10) {
    top: 85%;
    left: 5%;
    animation-duration: 23s;
}

.calculator-symbols .symbol:nth-child(11) {
    top: 50%;
    left: 15%;
    animation-duration: 15s;
}

.calculator-symbols .symbol:nth-child(12) {
    top: 30%;
    left: 40%;
    animation-duration: 18s;
}

@keyframes float-around {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, 10px) rotate(5deg);
    }
    50% {
        transform: translate(10px, 20px) rotate(0deg);
    }
    75% {
        transform: translate(-10px, 10px) rotate(-5deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Sticky filter bar styles */
.sticky-filter-bar {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 100 !important; /* Ensure it's above other elements */
}

.sticky-filter-bar.is-sticky {
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 0.97) !important;
}

.dark .sticky-filter-bar.is-sticky {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    background-color: rgba(17, 24, 39, 0.97) !important;
}

/* Horizontal scrolling for category filters on mobile */
.category-filter {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

.category-filter::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}

/* Category filter buttons */
.category-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: rgba(229, 231, 235, 0.5);
    color: #4b5563;
    cursor: pointer;
    flex-shrink: 0;
}

.dark .category-filter-btn {
    background-color: rgba(55, 65, 81, 0.5);
    color: #d1d5db;
}

.category-filter-btn:hover {
    background-color: rgba(209, 213, 219, 0.8);
}

.dark .category-filter-btn:hover {
    background-color: rgba(75, 85, 99, 0.8);
}

.category-filter-btn.active {
    background-color: #4f46e5;
    color: white;
}

.dark .category-filter-btn.active {
    background-color: #6366f1;
}

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay animations for sections */
#financial.reveal {
    transition-delay: 0s;
}

#health.reveal {
    transition-delay: 0.1s;
}

#math.reveal {
    transition-delay: 0.2s;
}

#construction.reveal {
    transition-delay: 0.3s;
}

#business.reveal {
    transition-delay: 0.4s;
}

#date.reveal {
    transition-delay: 0.5s;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dark-mode-toggle:hover {
    background-color: rgba(229, 231, 235, 0.8);
}

.dark .dark-mode-toggle:hover {
    background-color: rgba(75, 85, 99, 0.8);
}

/* Calculator Card Styles */
.calculator-card {
    position: relative;
    backface-visibility: hidden;
}

/* An anchor for category navigation */
#calc-categories {
    scroll-margin-top: 80px;
}

/* Media Queries */
@media (max-width: 768px) {
    .all-calculators-hub .hero-section {
        padding-top: 2rem;
        padding-bottom: 4rem;
    }
    
    .all-calculators-hub .hero-section h1 {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .all-calculators-hub .hero-section .text-xl {
        font-size: 1rem;
    }
    
    .sticky-filter-bar .container {
        padding: 0 1rem;
    }
    
    .category-filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    #calculators-container {
        padding: 0 0.5rem;
    }
    
    .calculator-category-section h2 {
        font-size: 1.5rem;
    }
    
    .calculator-category-section p {
        font-size: 1rem;
    }
    
    /* Better touch targets for mobile */
    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Fix grid layout for cards on small screens */
    .grid-cols-1.sm\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #2d3748;
}

/* Mobile Calculator */
.calculator-animation-mobile {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
}

.calculator-device-mobile {
    transition: all 0.5s ease;
    will-change: transform;
    box-shadow: 0 15px 30px -8px rgba(0, 0, 0, 0.3);
}

.element-mobile {
    z-index: -1;
} 