/* Custom styles for Calculator Hub */

/* Alpine.js x-cloak */
[x-cloak] {
    display: none !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    html {
        color-scheme: dark;
    }
}

/* Animations */
@keyframes gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

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

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

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.fade-in-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    @page {
        margin: 2cm;
    }
}

/* Cache control - prevent caching for dynamic content */
meta[http-equiv="Cache-Control"] {
    content: "no-cache, no-store, must-revalidate";
}

/* RTL support for Arabic */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] .rtl\:text-right {
    text-align: right;
}

/* Ad container placeholders - fixed height to prevent CLS */
.ad-container {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 0.5rem;
}

.ad-container-mobile-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 50px;
    z-index: 40;
}

@media (min-width: 768px) {
    .ad-container-mobile-bottom {
        display: none;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Improve form readability */
input[type="number"],
input[type="text"],
select,
textarea {
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Calculator result highlighting */
.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
}

/* Loading state */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request.htmx-indicator {
    display: inline;
}
