/* Custom CSS for Apas Website */

/* Mobile Menu Animations */
@keyframes mobileMenuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mobileMenuItemBounce {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.mobile-menu-overlay {
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(59, 130, 246, 0.95));
}

.mobile-menu-item {
    position: relative;
    overflow: hidden;
}

.mobile-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mobile-menu-item:hover::before {
    left: 100%;
}

.mobile-menu-item:hover {
    animation: iconPulse 0.6s ease-in-out;
}

.mobile-menu-item:active {
    transform: scale(0.95);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

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

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

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

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

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

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

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

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

/* Custom button hover effects */
.btn-hover-effect {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-hover-effect:hover::before {
    left: 100%;
}

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

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

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(30, 58, 138, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0.5rem;
    /* Só decoração: sem isto a camada fica por cima do card e engole os
       cliques em "Enviar fotos" e "Ver produto" */
    pointer-events: none;
}

.product-card:hover::before {
    opacity: 1;
}

/* Form focus effects */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    border-color: #f97316;
}

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

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

/* Mobile menu animation */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FAQ accordion animation */
.faq-content {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.faq-content.active {
    max-height: 200px;
}

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

.faq-btn.active i {
    transform: rotate(180deg);
}

/* Filter button active state */
.filter-btn.active {
    background-color: #f97316;
    color: white;
}

/* Custom gradient backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #1e3a8a, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom shadows */
.shadow-custom {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.shadow-custom-lg {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Hover effects for cards */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Custom form styles */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.3s ease;
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    color: #f97316;
    transform: translateY(-2px);
}

/* Success and error states */
.success-message {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Custom scrollbar for specific elements */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #f97316 #f1f1f1;
}

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

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 3px;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000 !important;
    }
    
    .bg-gray-50 {
        background-color: #fff !important;
    }
}

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

/* Banner Rotativo Styles */
.banner-slide {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.banner-slide.active {
    opacity: 1;
    z-index: 2;
}

.banner-title {
    animation: slideInFromTop 1s ease-out 0.5s both;
}

.banner-text {
    animation: slideInFromBottom 1s ease-out 0.8s both;
}

.banner-buttons {
    animation: slideInFromBottom 1s ease-out 1.1s both;
}

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

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

.banner-indicator {
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-indicator.active {
    opacity: 1;
    transform: scale(1.2);
}

.banner-prev,
.banner-next {
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.banner-prev:hover,
.banner-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Removed auto-rotation CSS animations - now handled by JavaScript */

/* Mobile optimizations */
@media (max-width: 768px) {
    .banner-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .banner-text {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    
    .banner-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .banner-prev,
    .banner-next {
        display: none;
    }
}

/* High contrast mode for banner */
@media (prefers-contrast: high) {
    .banner-slide {
        background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), var(--bg-image) !important;
    }
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for grid items */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }

/* Parallax effect for sections */
.parallax-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.parallax-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(30, 58, 138, 0.8), rgba(59, 130, 246, 0.8));
    z-index: -1;
}

.parallax-section > * {
    position: relative;
    z-index: 2;
}

/* Enhanced parallax with transform - removed to prevent overlap */
.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    z-index: -2;
}

/* Modern typography improvements */
.font-display {
    font-family: 'Alan Sans', system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Enhanced button styles */
.btn-modern {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

/* Floating animation for icons */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

.floating-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.floating-icon:nth-child(3) {
    animation-delay: 1s;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #1e3a8a, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced card hover effects */
.card-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(30, 58, 138, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    z-index: -1;
}

.card-enhanced:hover::before {
    opacity: 1;
}

.card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
