/**
 * ui-components.css
 * Styles for toast notifications, back-to-top, loading skeletons, and visual enhancements
 */

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 450px;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid var(--primary-color);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(450px);
    opacity: 0;
}

.toast i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--light-gray);
    color: var(--dark-color);
}

/* Toast Types */
.toast-success {
    border-left-color: #10b981;
}

.toast-success i {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error i {
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning i {
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info i {
    color: #3b82f6;
}

/* Mobile Toast */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .toast i {
        font-size: 1.2rem;
    }
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.floating-buttons-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 1000;
    pointer-events: none;
}

.floating-buttons-container>* {
    pointer-events: auto;
}

/* WhatsApp Floating Button */
.whatsapp-float-btn {
    width: 56px;
    height: 56px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-decoration: none;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

@keyframes pulse-whatsapp {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
    }
}

/* Back to Top Button */
.back-to-top {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: var(--white-color);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

.back-to-top-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle {
    stroke: rgba(255, 255, 255, 0.3);
    transition: stroke-dashoffset 0.1s;
}

.back-to-top i {
    position: relative;
    z-index: 1;
}

/* Mobile Back to Top */
@media (max-width: 768px) {
    .back-to-top {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .floating-buttons-container {
        bottom: 16px;
        right: 16px;
        gap: 10px;
    }

    .whatsapp-float-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        width: 46px;
        height: 46px;
    }

    .floating-buttons-container {
        bottom: 12px;
        right: 12px;
        gap: 8px;
    }

    .whatsapp-float-btn {
        width: 46px;
        height: 46px;
        font-size: 22px;
    }
}

/* ========================================
   LOADING SKELETONS
   ======================================== */
.skeleton {
    background: linear-gradient(90deg,
            var(--light-gray) 25%,
            rgba(var(--primary-rgb), 0.05) 50%,
            var(--light-gray) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 20px;
    border-radius: 12px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
}

/* ========================================
   LAZY LOAD IMAGES
   ======================================== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.4s ease;
}

img[data-src].loaded {
    opacity: 1;
}

[data-bg] {
    transition: background-image 0.4s ease;
}

/* ========================================
   MICRO-INTERACTIONS & ANIMATIONS
   ======================================== */

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Pulse animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.6s ease forwards;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    opacity: 0;
    animation: slideInRight 0.6s ease forwards;
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    opacity: 0;
    animation: scaleIn 0.4s ease forwards;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Glow effect */
.glow {
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.5);
}

/* Shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   SMOOTH SCROLL
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}



/* ========================================
   EXPORT DIALOG
   ======================================== */
.export-dialog .modal-card {
    width: min(500px, 90%);
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--white-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.export-option:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
    transform: translateX(4px);
}

.export-option i {
    font-size: 2rem;
    color: var(--primary-color);
}

.export-option strong {
    display: block;
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.export-option small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========================================
   FAQ ACCORDION
   ======================================== */
.faq-section {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.faq-header {
    text-align: center;
    margin-bottom: 40px;
}

.faq-title {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark-color);
    margin-bottom: 12px;
}

.faq-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.faq-item.open {
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.15);
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark-color);
    text-align: left;
    transition: all 0.3s;
}

.faq-question:hover {
    background: rgba(var(--primary-rgb), 0.03);
}

.faq-question i {
    font-size: 1rem;
    color: var(--primary-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer-content {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Mobile FAQ */
@media (max-width: 768px) {
    .faq-section {
        padding: 40px 16px;
    }

    .faq-title {
        font-size: 1.7rem;
    }

    .faq-subtitle {
        font-size: 1rem;
    }

    .faq-question {
        padding: 16px 20px;
        font-size: 0.95rem;
    }

    .faq-answer-content {
        padding: 0 20px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .faq-title {
        font-size: 1.5rem;
    }

    .faq-question {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .faq-answer-content {
        padding: 0 16px 14px;
        font-size: 0.85rem;
    }
}



/* ========================================
   TAX CALCULATOR
   ======================================== */
.tools-section {
    padding: 100px 20px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--accent-rgb), 0.03) 100%);
}

.tools-hub {
    max-width: 800px;
    margin: 0 auto;
}

.tools-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tool-tab-btn {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.tool-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.tool-tab-btn.active {
    background: var(--gradient-1);
    color: var(--white-color);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.3);
}

.tool-pane {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tool-pane.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.calculator-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white-color);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.calc-inputs {
    padding: 40px;
    border-right: 1px solid var(--border-color);
}

.calc-results {
    padding: 40px;
    background: rgba(var(--primary-rgb), 0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.result-placeholder i {
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.2;
    margin-bottom: 15px;
}

.result-data {
    width: 100%;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px dashed var(--border-color);
}

.result-item strong {
    font-size: 1.4rem;
    color: var(--dark-color);
}

.calc-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 20px;
    font-style: italic;
}

@media (max-width: 768px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }

    .calc-inputs {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 25px 15px;
    }

    .calc-results {
        padding: 30px 15px;
        min-height: 200px;
    }

    .result-item strong {
        font-size: 1.2rem;
    }

    /* UVT: apilar input + botón en columna desde móvil */
    .calc-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .calc-row .btn {
        width: 100%;
        padding: 14px;
        justify-content: center;
    }

    .calc-row .form-control {
        width: 100%;
        text-align: center;
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .tool-tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
    }

    .calc-inputs h3 {
        font-size: 1.1rem;
    }

    .result-item {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    .result-item strong {
        width: 100%;
        text-align: center;
        font-size: 1.5rem;
    }
}

/* ===== CALC ROW (UVT converter input + arrow button) ===== */
/* Desktop: input expands, button stays compact beside it   */
.calc-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calc-row .form-control {
    flex: 1;
    min-width: 0;
}

.calc-row .btn {
    flex-shrink: 0;
    width: auto;
    padding: 12px 18px;
}
