/* Importar variáveis */
@import url('clt-vc-variables.css');

/* Estilos base */
.clt-vc-form-fields .clt-vc-input-group label {
    display: inline-block;
    min-width: 200px;
    margin-right: 10px;
    color: var(--clt-vc-text);
}

.clt-vc-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--clt-vc-text);
    padding: 20px;
    background-color: var(--clt-vc-bg);
}

.clt-vc-container h2 {
    color: var(--clt-vc-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--clt-vc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clt-vc-version {
    font-size: 14px;
    color: var(--clt-vc-text-light);
    font-weight: normal;
    background: var(--clt-vc-bg-light);
    padding: 3px 8px;
    border-radius: var(--clt-vc-rounded-sm);
}

/* Grupos de entrada */
.clt-vc-form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.clt-vc-form-fields .clt-vc-input-group {
    flex: 1 1 calc(50% - 10px);
    min-width: 280px;
}

.clt-vc-options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0 20px;
    padding: 20px;
    border: 1px solid var(--clt-vc-border);
    border-radius: var(--clt-vc-rounded);
    background-color: var(--clt-vc-bg-light);
    box-shadow: var(--clt-vc-shadow-sm);
    align-items: flex-start;
}

.clt-vc-options-group .clt-vc-input-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.clt-vc-options-group .clt-vc-checkbox {
    margin: 0;
    width: 100%;
}

.clt-vc-options-group .clt-vc-checkbox-label {
    margin: 0;
    padding: 10px 15px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.clt-vc-input-group {
    margin-bottom: 15px;
}

.clt-vc-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--clt-vc-text);
    font-size: 14px;
}

.clt-vc-input-with-tooltip {
    position: relative;
    display: inline-block;
    width: 100%;
}

.clt-vc-tooltip {
    visibility: hidden;
    width: 240px;
    background-color: var(--clt-vc-text);
    color: var(--clt-vc-bg);
    text-align: left;
    border-radius: var(--clt-vc-rounded-sm);
    padding: 10px 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: var(--clt-vc-shadow);
    pointer-events: none;
}

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

.clt-vc-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--clt-vc-text) transparent transparent transparent;
}

/* Campos de entrada */
.clt-vc-container input[type="text"],
.clt-vc-container input[type="number"],
.clt-vc-container select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--clt-vc-border);
    border-radius: var(--clt-vc-rounded-sm);
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: var(--clt-vc-bg);
    color: var(--clt-vc-text);
    line-height: 1.5;
}

.clt-vc-container input[type="text"]:hover,
.clt-vc-container input[type="number"]:hover,
.clt-vc-container select:hover {
    border-color: var(--clt-vc-primary);
}

.clt-vc-container input[type="text"]:focus,
.clt-vc-container input[type="number"]:focus,
.clt-vc-container select:focus {
    border-color: var(--clt-vc-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--clt-vc-primary-light);
}

/* Estilos de Checkbox */
.clt-vc-checkbox {
    margin: 12px 0;
    position: relative;
}

.clt-vc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    cursor: pointer;
    margin: 8px 0;
    padding: 12px 16px;
    background: var(--clt-vc-bg-light);
    border-radius: var(--clt-vc-rounded-sm);
    transition: all 0.2s ease;
    width: 100%;
    user-select: none;
}

.clt-vc-checkbox-label:hover {
    background: var(--clt-vc-bg-lighter);
    transform: translateY(-1px);
    box-shadow: var(--clt-vc-shadow-sm);
}

.clt-vc-checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 20px;
    width: 20px;
    z-index: 1;
}

.clt-vc-checkbox-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--clt-vc-primary);
    border-radius: 4px;
    background: var(--clt-vc-bg);
    position: relative;
    margin-right: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clt-vc-checkbox-input:checked ~ .clt-vc-checkbox-custom {
    background-color: var(--clt-vc-primary);
    border-color: var(--clt-vc-primary);
}

.clt-vc-checkbox-input:checked ~ .clt-vc-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.clt-vc-checkbox-label:hover .clt-vc-checkbox-custom {
    border-color: var(--clt-vc-primary-dark);
    box-shadow: 0 0 0 3px var(--clt-vc-primary-light);
}

.clt-vc-checkbox-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--clt-vc-text);
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
}

/* Estilo para checkboxes desabilitados */
.clt-vc-checkbox-input:disabled ~ .clt-vc-checkbox-custom {
    background-color: var(--clt-vc-bg-light);
    border-color: var(--clt-vc-border);
    cursor: not-allowed;
}

.clt-vc-checkbox-input:disabled ~ .clt-vc-checkbox-text {
    color: var(--clt-vc-text-lighter);
    cursor: not-allowed;
}

/* Ícones de informação */
.clt-vc-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #1e73be;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    cursor: help;
    position: relative;
}

.clt-vc-info-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    margin-bottom: 10px;
    width: 200px;
    padding: 10px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Botões */
.clt-vc-button-group {
    display: flex;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.clt-vc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: var(--clt-vc-rounded);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--clt-vc-transition);
    box-shadow: var(--clt-vc-shadow-sm);
    line-height: 1.5;
}

.clt-vc-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--clt-vc-primary-light);
}

.clt-vc-button-primary {
    background-color: var(--clt-vc-primary);
    color: white;
    border: 1px solid var(--clt-vc-primary-dark);
}

.clt-vc-button-primary:hover {
    background-color: var(--clt-vc-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--clt-vc-shadow);
}

.clt-vc-button-primary:active {
    transform: translateY(0);
    box-shadow: var(--clt-vc-shadow-sm);
}

.clt-vc-button-secondary {
    background-color: var(--clt-vc-bg-light);
    color: var(--clt-vc-text);
    border: 1px solid var(--clt-vc-border);
}

.clt-vc-button-secondary:hover {
    background-color: var(--clt-vc-bg-lighter);
    transform: translateY(-2px);
    box-shadow: var(--clt-vc-shadow-sm);
    color: var(--clt-vc-primary);
    border-color: var(--clt-vc-primary);
}

.clt-vc-button-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Botão de Calcular sempre visível */
#clt-vc-submit {
    display: inline-flex;
}

/* Ações do Resultado */
#clt-vc-result-actions {
    margin: 30px 0 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.clt-vc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--clt-vc-primary);
    color: white;
    border: none;
    border-radius: var(--clt-vc-rounded);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    text-align: center;
}

.clt-vc-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: var(--clt-vc-primary-dark);
}

.clt-vc-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clt-vc-action-btn .dashicons {
    margin-right: 8px;
    font-size: 16px;
    width: auto;
    height: auto;
    line-height: 1;
}

/* Estilo específico para o botão de Copiar */
#clt-vc-copy {
    background-color: #4a5568;
}

#clt-vc-copy:hover {
    background-color: #2d3748;
}

/* Efeito de clique */
.clt-vc-action-btn:active {
    transform: scale(0.98);
}

/* Feedback visual ao copiar */
#clt-vc-copy.copied {
    background-color: #38a169;
    animation: pulse 1s;
}

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

/* Responsividade */
@media (max-width: 480px) {
    .clt-vc-action-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #clt-vc-result-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* Ícones dentro dos botões */
.clt-vc-button .dashicons {
    margin-right: 8px;
    font-size: 16px;
    width: auto;
    height: auto;
    line-height: 1;
}

/* Efeito de loading */
.clt-vc-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.clt-vc-button.loading:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: clt-vc-spin 0.6s linear infinite;
}

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

/* Ícones */
.dashicons {
    margin-right: 5px;
    font-size: 16px;
    width: auto;
    height: auto;
}

/* Resultado */
#clt-vc-resultado {
    margin-top: 30px;
    padding: 20px;
    border-radius: 4px;
    background-color: #f9f9f9;
    border-left: 4px solid #1e73be;
}

#clt-vc-resultado h3 {
    color: #1e73be;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Tabela de resultados */
.clt-vc-result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.clt-vc-result-table th,
.clt-vc-result-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.clt-vc-result-table th {
    font-weight: 600;
    color: #555;
    background-color: #f5f5f5;
}

.clt-vc-result-table tr:last-child td {
    border-bottom: none;
}

/* Responsividade para tabelas em telas pequenas */
@media (max-width: 768px) {
    .clt-vc-result-table {
        font-size: 14px;
    }
    
    .clt-vc-result-table th,
    .clt-vc-result-table td {
        padding: 8px 5px;
    }
    
    .clt-vc-result-table th {
        font-size: 13px;
    }
}

/* Destaque para valores positivos/negativos */
.clt-vc-positive {
    color: #1e73be;
    font-weight: 600;
}

.clt-vc-negative {
    color: #dc3545;
    font-weight: 600;
}

/* Seção de memória do cálculo */
.clt-vc-memory-section {
    margin-top: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #6c757d;
}

.clt-vc-memory-section h4 {
    margin-top: 0;
    color: #495057;
    display: flex;
    align-items: center;
}

.clt-vc-memory-section h4 .dashicons {
    margin-right: 8px;
}

/* Responsividade */
/* Responsividade */
@media (max-width: 768px) {
    .clt-vc-form-fields .clt-vc-input-group {
        flex: 1 1 100%; /* 1 coluna em telas menores */
        min-width: auto;
    }

    .clt-vc-options-group {
        flex-direction: column; /* Opções em 1 coluna em telas menores */
        gap: 10px;
    }

    .clt-vc-options-group .clt-vc-input-group {
        flex: 1 1 100%;
        margin-bottom: 0;
    }

    .clt-vc-button-group {
        flex-direction: column;
    }
    
    .clt-vc-button-group button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    #clt-vc-result-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .clt-vc-action-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Responsividade para tooltips em telas pequenas */
    .clt-vc-tooltip {
        width: 160px;
        font-size: 11px;
    }
    
    .clt-vc-container {
        padding: 15px;
    }
    
    .clt-vc-container h2 {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .clt-vc-version {
        margin-top: 10px;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#clt-vc-resultado {
    animation: fadeIn 0.3s ease-out;
}

/* Estilos para a impressão */
@media print {
    .clt-vc-container {
        padding: 0;
        max-width: 100%;
    }
    
    .clt-vc-button-group,
    #clt-vc-result-actions {
        display: none !important;
    }
    
    #clt-vc-resultado {
        border: none;
        padding: 0;
    }
    
    .clt-vc-memory-section {
        page-break-inside: avoid;
    }
}
