/* Variáveis */
:root {
    --primary-color: #9EE86F;
    --primary-color-20: #9EE86F20;
    --primary-color-40: #9EE86F40;
    --secondary-color: #163300;
    --background-dark: #131511;
    --background-medium: #1E221D;
    --background-light: #2B2C29;
    --background-light-40: #2B2C2940;
    --background-light-90: #2B2C2990;
    --placeholder: #555B50;
    --text-secondary: #A3A3A3;
    --border-glass: #3E473B;
}

/* Estilos bases */
body {
    background: var(--background-dark);
    color: #fff;
    padding-bottom: 100px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
}

a {
    transition: all 0.3s ease;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

/* App Content */
.app-content {
    max-width: 450px !important;
    display: flex;
    flex-direction: column;
    margin: auto;
}

/* Inputs */
input::placeholder {
    color: var(--placeholder) !important;
}

input.form-control {
    background: var(--background-light) !important;
    border: 1px solid var(--background-light) !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: 22px;
    padding: 10px 15px !important;
    border-radius: 10px !important;
}

select.form-select {
    background: var(--background-light) !important;
    border: 1px solid var(--background-light) !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: 22px;
    padding: 10px 15px !important;
    border-radius: 10px !important;
}

.form-label {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 18px;
}

/* Modal */
.modal.fade.show {
    display: flex !important;
    justify-content: center;
}


.modal-dialog {
    width: 100% !important;
    margin: 0px !important;
}

.modal-header {
    border-bottom: none !important;
    font-weight: bold !important;
    color: var(--primary-color) !important;
    padding: 30px 20px 0px 20px !important;
}

.modal-body {
    padding: 30px 20px !important;
}

.modal-content {
    background: var(--background-dark) !important;
    border-radius: 0px 0px 15px 15px !important;
    padding: 0px !important;
    box-shadow: 0px 0px 50px rgba(0, 0, 0, 0.8);
}

.modal-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#pwaInstallSection {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px dashed var(--placeholder);
}

#installPwaButton {
    width: 100%;
    background: var(--primary-color);
    border: none !important;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#installPwaButton a {
    background: var(--primary-color) !important;
}

#installPwaButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-row-inside {
    border-bottom: 1px dashed var(--placeholder);
    padding-bottom: 30px;
}

.modal-row-inside:last-child {
    border-bottom: none;
    padding-bottom: 0px;
}

.modal-row-inside input.form-control {
    margin-top: 15px;
}

/* Switches */
.form-check {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: none;
    padding-left: 0px !important;
    margin-bottom: 0px !important;
}

.form-check label {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 18px;
}

.form-switch .form-check-input {
    width: 60px;
    height: 35px;
}

.form-check-input {
    background-color: var(--background-light);
    border: none !important;
    box-shadow: none !important;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='131511'/%3e%3c/svg%3e")
}

.form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='131511'/%3e%3c/svg%3e")
}

/* Skeleton loading */
.skeleton {
    width: 100%;
    background: linear-gradient(90deg, var(--background-light) 25%, #3E473B 50%, var(--background-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 2s infinite linear;
    border-radius: 8px;
    color: transparent !important;
    transition: all 0.3s ease;
}

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

.single-input-form {
    background: var(--background-light);
    padding: 0 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    margin-top: 15px;
    border: 1px solid var(--border-glass);
}

.single-input-form svg {
    color: var(--primary-color);
}

.single-input-form input {
    background: transparent !important;
    border: none !important;
    font-size: 26px;
    box-shadow: none !important;
    margin: 0px !important;
    color: #ffffff !important;
    padding: 20px !important;
}

.header {
    width: 100%;
    max-width: 450px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    position: fixed;
    top: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, var(--background-dark) 20%, transparent 100%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand svg {
    color: var(--primary-color);
    width: 20px;
}

.header h2 {
    color: var(--primary-color);
    margin: 0px !important;
}

.link-icon {
    background: var(--background-medium);
    line-height: 100%;
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 100%;
}

.link-icon:hover {
    background: var(--primary-color);
    color: var(--background-dark);
    text-decoration: none;
}

.link-icon svg {
    display: block;
    margin: auto;
    margin-top: 13px;
}

.main {
    margin-top: 100px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.usd-conversion {
    display: flex;
    align-items: center;
    gap: 15px;
}

.usd-rate {
    width: fit-content;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

.small-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Navegação */
.nav-pills {
    display: flex;
    width: calc(100% - 60px);
    max-width: 410px;
    gap: 7px;
    position: fixed;
    bottom: 0px;
    background: var(--background-light-90);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px !important;
    left: 0;
    right: 0;
    border-radius: 100px;
    padding: 8px;
    z-index: 999;
}

.nav-pills .nav-item {
    flex: 1;
}

.nav-pills .nav-link {
    width: 100%;
    text-align: center;
}

.nav-pills .nav-link {
    background: var(--background-light-40);
    color: var(--text-secondary);
    font-weight: bold;
    border-radius: 100px;
    padding: 5px 0 8px 0;
    font-size: 12px;
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: all 0.2s ease;
}

.nav-pills .nav-link:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.nav-pills .nav-link.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--primary-color-40);
    animation: pulse 0.3s ease;
}

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

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0px;
    line-height: 120%;
}

.nav-link svg {
    width: 18px;
}

.tab-pane {
    padding: 20px;
}

/* Estilos do app */
.conversion {
    background: var(--primary-color-20);
    border: 1px solid var(--primary-color);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0px 0px 30px var(--primary-color-20);
}

.conversion.show {
    opacity: 1;
}

.conversion .conv-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.conversion .conv-row span {
    transition: all 0.3s ease;
}

@keyframes countUp {
    0% {
        opacity: 0.5;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversion .conv-row span.animating {
    animation: countUp 0.4s ease;
}

.conversion .conv-row h4 {
    color: var(--text-secondary);
    margin: 0px !important;
}

.conversion .conv-row .tax {
    color: var(--placeholder);
}

.conversion .conv-row.result h4 {
    color: #ffffff !important;
    font-weight: bold;
}

.conversion .conv-row.result span {
    color: var(--primary-color);
    font-weight: bold;
}

.conversion .conv-row:last-child {
    border-top: 1px dashed var(--placeholder);
    padding-top: 15px;
}

/* Tab Analisar */
.image-actions-box {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.image-actions-box a {
    width: 100%;
    height: auto;
    background: var(--background-light);
    display: flex;
    gap: 10px;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none !important;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-glass);
}

.image-actions-box a svg {
    color: var(--primary-color);
}

.image-result-box {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.uploaded-image {
    position: relative;
    width: 100%;
}

.uploaded-image .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--background-medium);
    width: 50px;
    height: 50px;
    border-radius: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.uploaded-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 15px;
}

/* Overlay de análise por IA */
.ai-analyzing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background: linear-gradient(
        45deg,
        rgba(158, 232, 111, 0.15) 0%,
        rgba(158, 232, 111, 0.3) 25%,
        rgba(158, 232, 111, 0.15) 50%,
        rgba(158, 232, 111, 0.3) 75%,
        rgba(158, 232, 111, 0.15) 100%
    );
    background-size: 400% 400%;
    animation: ai-analyzing 3s ease infinite, ai-pulse 2s ease-in-out infinite;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    overflow: hidden;
}

.ai-analyzing-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(158, 232, 111, 0.4) 50%,
        transparent 100%
    );
    animation: ai-scan 2s linear infinite;
}

.ai-analyzing-overlay .ai-icon {
    position: relative;
    z-index: 6;
    animation: ai-float 3s ease-in-out infinite;
}

.ai-analyzing-overlay svg {
    width: 48px;
    height: 48px;
    color: #ffffff;
}

@keyframes ai-analyzing {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes ai-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes ai-scan {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes ai-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.product-title {
    color: var(--primary-color);
}

.image-price {
    background: var(--background-light);
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-glass);
}

.image-price-row svg {
    color: var(--primary-color);
    width: 20px;
}

.converted-price {
    color: var(--primary-color);
}

.br-best-price {
    background: var(--primary-color-20);
    border: 1px solid var(--primary-color);
    border-radius: 15px;
    padding: 15px 20px;
}

.br-best-price span {
    color: #ffffff;
}

.br-best-price h2 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0px !important;
}

.marketplaces-result {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.marketplace-row {
    border: 1px solid var(--border-glass);
    border-radius: 15px;
    padding: 15px 20px;
}

.marketplace-row .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.marketplace-row .price-row .seller {
    color: var(--text-secondary);
}

.marketplace-row .price-row .price {
    color: var(--primary-color);
    font-weight: bold;
}

/* Busca de produtos */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.product-item {
    display: flex;
    gap: 8px;
    border: 1px solid var(--border-glass);
    border-radius: 15px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.product-item:hover {
    border-color: var(--primary-color);
    background: var(--background-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(158, 232, 111, 0.15);
}

.product-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(158, 232, 111, 0.1);
}

.product-item img {
    width: 100%;
    max-width: 120px;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    border-radius: 10px;
    aspect-ratio: 1 / 1;
}

.product-item h4 {
    margin: 0px !important;
    padding-left: 5px;
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-item span {
    padding-left: 5px;
}

.product-item .product-seller {
    color: var(--text-secondary);
    font-size: 14px;
}

.product-item .product-price {
    font-weight: bold;
    font-size: 18px;
}

.product-item-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 8px;
}