/**
 * Componentes Avançados - Cores do Reino
 * 
 * @package CoresDoReino
 */

/* Animações e Transições */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.card, .benefit-item, .testimonial-item, .product-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

/* Efeitos de Hover Avançados */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::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::before {
    left: 100%;
}

.btn.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Header Responsivo */
.site-header {
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

/* Menu Mobile Avançado */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 15px;
    position: relative;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--gray-700);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(2) {
    margin: 4px 0;
}

.menu-toggle[aria-expanded="true"] .hamburger span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger span:last-child {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        padding: 80px 20px 20px;
    }
    
    .main-nav.toggled {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid var(--gray-200);
    }
    
    .main-nav a {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
    }
    
    .body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }
}

/* Contador Regressivo Estilizado */
.countdown-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.time-unit {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-width: 80px;
}

.time-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.time-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Pricing Cards Avançados */
.pricing-card {
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.featured-plan {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.price-display {
    text-align: center;
    margin: 1rem 0;
}

.old-price {
    display: block;
    text-decoration: line-through;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.current-price {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--success);
    line-height: 1;
}

/* Testimonials Avançados */
.testimonial-item {
    position: relative;
    padding-top: 2rem;
}

.testimonial-item::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: serif;
}

.stars {
    color: var(--warning);
    margin-bottom: 1rem;
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: -400px;
    width: 350px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: right 0.3s ease;
}

.notification.show {
    right: 20px;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 0.8rem;
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--error);
}

.notification-warning {
    border-left: 4px solid var(--warning);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

/* Modal de Imagem */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botão Voltar ao Topo */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* WhatsApp Flutuante */
.whatsapp-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
}

.whatsapp-button {
    display: flex;
    align-items: center;
    background: #25d366;
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-button:hover {
    background: #128c7e;
    transform: translateY(-2px);
    color: white;
}

.whatsapp-button i {
    font-size: 1.5rem;
    margin-right: 8px;
}

.whatsapp-text {
    font-weight: 600;
    font-size: 0.9rem;
}

@keyframes whatsappPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    .whatsapp-text {
        display: none;
    }
    
    .whatsapp-button {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        justify-content: center;
        padding: 0;
    }
    
    .whatsapp-button i {
        margin: 0;
        font-size: 1.8rem;
    }
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Lazy Loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Formulários Avançados */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    position: absolute;
    top: 12px;
    left: 16px;
    color: var(--gray-500);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    top: -8px;
    left: 12px;
    font-size: 0.8rem;
    color: var(--primary-color);
    background: var(--white);
    padding: 0 4px;
}

/* Badges e Tags */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-primary { background: var(--primary-color); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-error { background: var(--error); color: white; }

/* Progress Bar */
.progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Responsividade Avançada */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .notification {
        width: calc(100% - 40px);
        right: -100%;
    }
    
    .notification.show {
        right: 20px;
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .btn-xl {
        padding: 16px 24px;
        font-size: 1rem;
    }
    
    .time-unit {
        min-width: 60px;
        padding: 0.75rem;
    }
    
    .time-number {
        font-size: 1.5rem;
    }
}
