/* Reset e Variáveis - Paleta Vermelho, Branco e Creme */
:root {
    --primary-color: #c41e3a;
    --primary-hover: #a01a2f;
    --primary-light: #e63946;
    --primary-dark: #8b1525;
    --secondary-color: #dc3545;
    --accent-red: #d62828;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #fef9f3;
    --bg-cream: #faf5ef;
    --bg-cream-light: #fefcf8;
    --surface-color: #ffffff;
    --text-primary: #2c1810;
    --text-secondary: #5c4a3a;
    --text-light: #8b7355;
    --border-color: #e8ddd4;
    --border-light: #f0e8df;
    --shadow-sm: 0 1px 3px 0 rgba(196, 30, 58, 0.08), 0 1px 2px -1px rgba(196, 30, 58, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(196, 30, 58, 0.1), 0 2px 4px -2px rgba(196, 30, 58, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(196, 30, 58, 0.12), 0 8px 10px -6px rgba(196, 30, 58, 0.08);
    --shadow-xl: 0 25px 50px -12px rgba(196, 30, 58, 0.2);
    --shadow-red: 0 10px 30px -5px rgba(196, 30, 58, 0.3);
    --radius: 20px;
    --radius-sm: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #c41e3a 0%, #dc3545 50%, #a01a2f 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(196, 30, 58, 0.15), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(220, 53, 69, 0.12), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(160, 26, 47, 0.1), transparent 50%),
        linear-gradient(180deg, rgba(250, 245, 239, 0.05) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
}

.header-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 249, 243, 0.95) 100%);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(196, 30, 58, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    color: var(--primary-color);
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(196, 30, 58, 0.25));
    animation: float 3s ease-in-out infinite;
}

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

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-red) 50%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(196, 30, 58, 0.1);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 249, 243, 0.95) 100%);
    backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(196, 30, 58, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.tab-button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-red) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
    border-radius: var(--radius-sm);
}

.tab-button:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    background: rgba(196, 30, 58, 0.05);
}

.tab-button.active {
    color: white;
    box-shadow: var(--shadow-md), 0 4px 12px rgba(196, 30, 58, 0.25);
}

.tab-button.active::before {
    opacity: 1;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 249, 243, 0.95) 100%);
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(196, 30, 58, 0.05);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-red), 0 0 0 1px rgba(196, 30, 58, 0.1);
    transform: translateY(-3px);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 1rem;
    line-height: 1.6;
}

.card-error {
    border-left: 5px solid var(--error-color);
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.08) 0%, rgba(196, 30, 58, 0.05) 100%);
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.form-input {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.12), 0 2px 8px rgba(196, 30, 58, 0.1);
    transform: translateY(-1px);
    background: var(--bg-cream-light);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-select {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%23c41e3a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 45px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.12), 0 2px 8px rgba(196, 30, 58, 0.1);
    transform: translateY(-1px);
    background: var(--bg-cream-light);
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--bg-color);
}

.form-select option {
    padding: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Button */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-red) 50%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-lg), 0 4px 12px rgba(196, 30, 58, 0.3);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-red), 0 8px 24px rgba(196, 30, 58, 0.4);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 50%, var(--accent-red) 100%);
}

.btn-primary:active {
    transform: translateY(-1px);
}

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

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
    line-height: 1;
}

.btn-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* Results */
.results-section {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-item {
    padding: 24px;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.06) 0%, rgba(220, 53, 69, 0.04) 50%, rgba(250, 245, 239, 0.8) 100%);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(196, 30, 58, 0.1);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1), rgba(220, 53, 69, 0.08));
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    z-index: -1;
}

.result-item:hover::before {
    opacity: 1;
}

.result-item:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(196, 30, 58, 0.15);
    transform: translateX(6px) scale(1.01);
    border-left-color: var(--accent-red);
}

.result-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.result-row:hover {
    background: rgba(196, 30, 58, 0.08);
}

.result-row:last-child {
    margin-bottom: 0;
}

.result-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-value {
    color: var(--text-primary);
    word-break: break-word;
    font-weight: 500;
}

.result-cep {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border-color);
    letter-spacing: -0.3px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
}

.result-cep:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.12), rgba(220, 53, 69, 0.08));
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
}

.result-cep::after {
    content: '📋 Clique para copiar';
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
}

.result-cep:hover::after {
    opacity: 1;
    bottom: -28px;
}

.result-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.result-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Error Pop-up */
.error-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.error-popup {
    background: linear-gradient(135deg, #dc3545 0%, #c41e3a 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.error-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.error-popup-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.error-popup-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ffffff;
}

.error-popup-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: var(--transition);
    flex-shrink: 0;
}

.error-popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.error-popup-close svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}

.error-popup-content {
    padding: 24px;
}

.error-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    line-height: 1.4;
}

.error-popup-message {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
}

.error-popup-message strong {
    font-weight: 600;
    color: #ffffff;
}

/* Error (mantido para compatibilidade) */
.error-section {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.error-icon {
    font-size: 2rem;
}

.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

.error-message {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1), rgba(160, 26, 47, 0.05));
    border-radius: var(--radius);
    margin-top: 20px;
    backdrop-filter: blur(10px);
}

/* Loading State */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    box-shadow: 0 0 8px rgba(196, 30, 58, 0.3);
}

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

/* Pulse animation for loading button */
.btn-primary:disabled {
    animation: pulse-btn 1.5s ease-in-out infinite;
}

@keyframes pulse-btn {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.9;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .logo-container {
        gap: 12px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-content {
        padding: 28px 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-button {
        padding: 12px 20px;
    }
    
    .result-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .result-label {
        min-width: auto;
    }
    
    .result-item {
        padding: 20px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .form-input,
    .form-select {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .result-cep::after {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .card-description {
        font-size: 0.9rem;
    }
    
    .result-cep {
        font-size: 1.15rem;
        padding: 10px 12px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
    animation: bounce 2s ease-in-out infinite;
}

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

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-description {
    font-size: 0.95rem;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Seleção de texto personalizada */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--accent-red));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-hover), var(--primary-color));
}

/* Animação de entrada para cards */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideUp 0.5s ease-out;
}

/* Efeito de foco nos inputs */
.form-input:hover,
.form-select:hover {
    border-color: var(--primary-color);
    background: var(--bg-cream-light);
}

/* Badge de status */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--success-color), #218838);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--text-primary);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: var(--shadow-lg);
}


/* Efeito de brilho nos cards */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.7s;
}

.card:hover::after {
    left: 100%;
}

/* Animação de entrada suave */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeInUp 0.6s ease-out;
}

/* Efeito de foco melhorado */
.form-input:focus,
.form-select:focus {
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.15);
    }
}

/* Indicador de sucesso */
.success-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success-color);
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Melhoria no botão de fechar */
.btn-close {
    transition: var(--transition);
}

.btn-close:hover {
    transform: rotate(90deg);
    color: var(--error-color);
}

/* Efeito de digitação no placeholder */
@keyframes placeholderShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.form-input:focus::placeholder,
.form-select:focus::placeholder {
    animation: placeholderShift 2s ease-in-out infinite;
}

/* Sombra dinâmica nos cards */
.card {
    position: relative;
    overflow: hidden;
}

/* Efeito de onda ao clicar */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Melhoria na transição de tabs */
.tab-content {
    transform-origin: top;
}

.tab-content.active {
    animation: tabSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tabSlide {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Melhorias profissionais adicionais */
.card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.form-input:focus,
.form-select:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.12), 0 4px 12px rgba(196, 30, 58, 0.1);
}

.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Melhorias visuais nos resultados */
.result-item {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Scrollbar personalizada para tabela */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-red));
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-color));
}

/* Animação suave para linhas da tabela */
@keyframes tableRowFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bairros-table tbody tr {
    animation: tableRowFadeIn 0.3s ease-out backwards;
}

/* Efeito de loading melhorado */
.table-wrapper .loading {
    margin: 0 auto;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(196, 30, 58, 0.2);
    border-top-color: var(--primary-color);
}

/* Indicador de carregamento melhorado */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Efeito de destaque no hover dos resultados */
.result-item {
    overflow: hidden;
}

/* Animação de entrada dos resultados */
@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Efeito de gradiente animado no fundo */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
}

/* Input com botão de limpar */
.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-clear .form-input {
    flex: 1;
    padding-right: 45px;
}

.btn-clear-input {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    width: 28px;
    height: 28px;
    z-index: 10;
}

.btn-clear-input svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-clear-input:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-clear-input:hover svg {
    color: var(--error-color);
    transform: rotate(90deg);
}

/* Botões de ação do formulário */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-actions .btn {
    flex: 1;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, #4a5568 100%);
    color: white;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -10px rgba(92, 74, 58, 0.4);
    background: linear-gradient(135deg, #4a3d2f 0%, var(--text-secondary) 100%);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-secondary:hover::before {
    left: 100%;
}

/* Responsivo para botões de ação */
@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Animação para o botão de limpar */
@keyframes clearButtonPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.btn-clear-input {
    animation: clearButtonPop 0.3s ease-out;
}

/* Tabs responsivo para 3 abas */
@media (max-width: 768px) {
    .tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .tab-button:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .tabs {
        grid-template-columns: 1fr;
    }
    
    .tab-button:last-child {
        grid-column: auto;
    }
}

/* Estilos para tabela de bairros */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.table-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.bairros-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.12), rgba(220, 53, 69, 0.08));
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(196, 30, 58, 0.2);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(196, 30, 58, 0.05);
    background: white;
    border: 1px solid var(--border-light);
}

.bairros-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
}

.bairros-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-red) 50%, var(--primary-dark) 100%);
    color: white;
}

.bairros-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.bairros-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.bairros-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08), rgba(220, 53, 69, 0.05));
    transform: translateX(4px);
}

.bairros-table tbody tr:last-child {
    border-bottom: none;
}

.bairros-table td {
    padding: 14px 20px;
    color: var(--text-primary);
}

.bairros-table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.bairros-table td:nth-child(2) {
    color: var(--text-secondary);
    font-weight: 500;
}

.bairros-table .cep-cell {
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    transition: var(--transition);
    position: relative;
}

.bairros-table .cep-cell:hover {
    color: var(--primary-hover);
    transform: scale(1.05);
}

.bairros-table .cep-cell::after {
    content: '📋';
    margin-left: 8px;
    opacity: 0;
    transition: var(--transition);
    font-size: 0.85rem;
}

.bairros-table .cep-cell:hover::after {
    opacity: 1;
}

/* Botão listar bairros - ajuste de espaçamento */
#tab-bairro .form {
    margin-bottom: 0;
}

#tab-bairro .btn-primary {
    margin-top: 8px;
    width: 100%;
}

/* Responsivo para tabela */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .bairros-table {
        font-size: 0.85rem;
    }
    
    .bairros-table th,
    .bairros-table td {
        padding: 12px 14px;
    }
    
    .bairros-table th {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .table-title {
        font-size: 1.2rem;
    }
    
    .bairros-table {
        font-size: 0.8rem;
    }
    
    .bairros-table th,
    .bairros-table td {
        padding: 10px 12px;
    }
    
    .bairros-table th {
        font-size: 0.75rem;
        padding: 10px 8px;
    }
}
