/* Custom Styles for HELOC Payment Calculator */

/* Global Styles */
body {
    scroll-behavior: smooth;
}

/* Header Styles */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

/* Button Styles */
.btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-6 rounded-md transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2;
}

.btn-secondary {
    @apply bg-gray-200 hover:bg-gray-300 text-gray-700 font-semibold py-2 px-6 rounded-md transition-all duration-300;
}

/* Form Styles */
.form-group label {
    @apply block text-gray-700 font-medium mb-2;
}

.form-group input,
.form-group select {
    @apply w-full px-3 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-600 focus:border-transparent transition-colors duration-300;
}

/* Card Styles */
.card {
    @apply bg-white p-6 rounded-lg shadow-lg transition-transform duration-300 hover:shadow-xl;
}

/* Section Padding */
.section-padding {
    @apply py-16;
}

/* FAQ Styles */
.faq-toggle {
    @apply w-full flex justify-between items-center p-5 text-left bg-white hover:bg-gray-50 transition-colors duration-300;
}

.faq-toggle.active i {
    @apply transform rotate-180 transition-transform duration-300;
}

.faq-content {
    @apply hidden p-5 pt-0 border-t border-gray-200;
}

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

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        @apply px-4;
    }
    
    h1 {
        @apply text-xl;
    }
    
    h2 {
        @apply text-2xl;
    }
    
    h3 {
        @apply text-xl;
    }
}

/* Chart Container */
#payment-chart {
    max-height: 250px;
}

/* Amortization Table */
#amortization-table tr {
    @apply hover:bg-gray-50 transition-colors duration-150;
}

/* Mobile Menu Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu.show {
    display: block;
    animation: slideDown 0.3s ease-out forwards;
}

/* Input Focus Effects */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Button Focus Effects */
button:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Accessibility Styles */
.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;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        @apply text-black;
    }
    
    .bg-gray-50 {
        @apply bg-gray-200;
    }
    
    .text-gray-600 {
        @apply text-gray-900;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3b82f6;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background-color: #2563eb;
}