/* ========== RESET & BASE ========== */
* {
    box-sizing: border-box;
}

:root {
    --primary-color: #25D366;
    --primary-hover: #128C7E;
    --secondary-color: #075E54;
    --accent-color: #DCF8C6;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== HEADER ========== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary-hover) !important;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* ========== HOME PAGE ========== */
.hero-section {
    padding: 3rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.tool-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    color: inherit;
    text-decoration: none;
}

.tool-icon {
    margin-bottom: 1.5rem;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.tool-description {
    color: var(--text-muted);
    margin: 0;
}

/* ========== TOOL PAGES ========== */
.func-wrap {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.tool-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.form-container {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background-color: #198754;
    color: white;
}

.btn-success:hover {
    background-color: #146c43;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-secondary {
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-light);
    border-color: var(--text-muted);
}

.result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid var(--border-color);
}

.alert {
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.info-panel {
    background-color: var(--bg-light);
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.info-content h5 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.info-content h6 {
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.info-content ul {
    margin-bottom: 1.5rem;
}

.info-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* ========== FOOTER ========== */
.site-footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.site-footer p {
    margin-bottom: 0;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .info-panel {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .info-panel {
        padding: 1rem;
    }
    
    .site-footer {
        text-align: center;
    }
    
    .site-footer .row > div {
        text-align: center !important;
        margin-bottom: 1rem;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-section {
    animation: fadeIn 0.3s ease;
}

.alert {
    animation: fadeIn 0.3s ease;
}

/* ========== UTILITIES ========== */
.text-success {
    color: #198754 !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.small {
    font-size: 0.875rem;
}
/* Estilos para o Contador de Caracteres */
.show-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    align-items: center;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-feature-settings: 'tnum' 1; /* Números tabulares para melhor alinhamento */
}

/* Responsivo para dispositivos móveis */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .show-result {
        padding: 1.5rem;
    }
}

/* Melhoria no textarea para o contador */
#texto {
    min-height: 200px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

/* Animação suave nos números */
.stat-number {
    transition: all 0.3s ease;
}

.stat-number:hover {
    transform: scale(1.05);
}
/* Estilos específicos para o contador de datas */
.date-counter-container {
    max-width: 600px;
    margin: 0 auto;
}

.date-counter-container .box {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.date-counter-container .wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.date-counter-container .form-group {
    display: flex;
    flex-direction: column;
}

.date-counter-container .form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.date-counter-container .form-control {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.date-counter-container .form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.date-counter-container .btn-classic {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-counter-container .btn-classic:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.date-counter-container .resultado {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    text-align: center;
    border: 2px solid #d1d5db;
}

.date-counter-container .flex {
    display: flex;
}

.date-counter-container .items-center {
    align-items: center;
}

.date-counter-container input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.date-counter-container label {
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #6b7280;
}

.date-counter-container #result p {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.date-counter-container .text-danger {
    color: #dc2626;
    font-weight: 500;
    text-align: center;
    display: block;
    margin-top: 1rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .date-counter-container .box {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .date-counter-container .resultado {
        font-size: 1.25rem;
    }
}
/* Estilos específicos para conversor de texto */
.legenda {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.origem, .destino {
    min-height: 150px;
    resize: vertical;
    width: 100%;
    margin-bottom: 1rem;
}

.destino {
    background-color: var(--bg-light);
}

.opt-extra {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap; /* Permite quebrar linha no mobile */
}

.opt-extra input[type="radio"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.opt-extra label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    white-space: nowrap; /* Evita quebra de texto */
    min-width: fit-content; /* Garante largura mínima */
}

.opt-extra label:hover {
    color: var(--primary-color);
}

.opt-extra input[type="radio"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

.col-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.botao {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botao:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

/* CORREÇÃO: Botão limpar com contraste adequado */
.btn-outline-secondary:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .opt-extra {
        flex-direction: column; /* Coloca os radio buttons em coluna */
        gap: 1rem;
        align-items: flex-start; /* Alinha à esquerda */
    }
    
    .opt-extra label {
        font-size: 1rem; /* Garante tamanho adequado */
        padding: 0.25rem 0; /* Espaçamento vertical */
    }
    
    .col-btn {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .botao {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .opt-extra {
        padding: 1rem 0.75rem; /* Reduz padding lateral */
        gap: 0.75rem;
    }
    
    .opt-extra label {
        font-size: 0.95rem; /* Tamanho menor para mobile pequeno */
    }
    
    .origem, .destino {
        min-height: 120px;
    }
    
    /* Botões de ação responsivos */
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .button-group .btn {
        width: 100%;
        margin-right: 0 !important;
    }
}