@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

:root {
    --bg-primary: rgb(9, 9, 11);
    --bg-secondary: rgb(24, 24, 27);
    --bg-tertiary: rgb(39, 39, 42);
    --text-primary: rgb(250, 250, 250);
    --text-secondary: rgb(212, 212, 216);
    --text-tertiary: rgb(161, 161, 170);
    --text-disabled: rgb(113, 113, 122);
    --purple-static: #C084FC;
    --purple-bright: #A855F7;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-active: rgba(255, 255, 255, 0.3);
    --card-bg: rgba(9, 9, 11, 0.5);
}

::selection {
    background: rgba(168, 85, 247, 0.4);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 74, 74, 0.8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(106, 106, 106, 0.9);
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(to bottom, #000000, rgb(9, 9, 11), #000000);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Canvas Matrix Effect */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.25;
}

/* Partículas flutuantes roxas */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: #e9d5ff;
    box-shadow: 0 0 15px rgba(192, 132, 252, 0.8);
    filter: blur(0.5px);
    animation: float-up linear infinite;
    pointer-events: none;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    10% {
        opacity: var(--particle-opacity, 0.7);
    }
    90% {
        opacity: var(--particle-opacity, 0.7);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px);
    }
}

/* Glassmorphism Panel */
.glass-panel {
    position: relative;
    z-index: 1;
    max-width: 950px;
    margin: 0 auto;
    padding: 25px;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 1px solid var(--border-default);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid var(--border-default);
    position: relative;
    transition: border-color 0.3s ease;
}

.header:hover {
    border-color: var(--border-hover);
}

.header h1 {
    color: var(--purple-bright);
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.55),
                 0 0 44px rgba(168, 85, 247, 0.32);
    animation: title-glow-purple 3s ease-in-out infinite;
}

@keyframes title-glow-purple {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
    }
}

.subtitle {
    color: var(--text-tertiary);
    font-size: 1.1em;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.tab-button:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    background: rgba(168, 85, 247, 0.05);
}

.tab-button.active {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple-static);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Card */
.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border-default);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
}

.card h2 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-tertiary);
    margin-bottom: 20px;
    line-height: 1.625;
}

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    background: rgb(244, 244, 245);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: rgb(63, 63, 70);
    transform: translateY(-2px);
}

/* Regiões Grid */
.regioes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.regiao-card {
    padding: 20px;
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    color: var(--text-primary);
}

.regiao-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.regiao-card.selected {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple-static);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.2);
}

.regiao-numero {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--purple-static);
}

.regiao-card.selected .regiao-numero {
    color: var(--purple-bright);
}

.regiao-nome {
    font-size: 0.85em;
    color: var(--text-tertiary);
}

.regiao-card.selected .regiao-nome {
    color: var(--text-secondary);
}

/* Resultado */
.resultado {
    margin-top: 24px;
    padding: 20px;
    background: rgba(39, 39, 42, 0.3);
    border-radius: 16px;
    border: 1px solid var(--border-default);
    border-left: 4px solid var(--purple-bright);
    transition: all 0.3s ease;
}

.resultado.hidden {
    display: none;
}

.resultado h3 {
    color: #4ade80;
    margin-bottom: 15px;
    font-weight: 600;
}

/* CPF Container */
.cpf-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.cpf-display {
    flex: 1;
    min-width: 250px;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--purple-bright);
    text-align: center;
    padding: 20px;
    background: rgba(9, 9, 11, 0.5);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    font-family: 'Space Grotesk', monospace;
    transition: all 0.3s ease;
}

/* Botão Copiar */
.btn-copiar {
    padding: 15px 25px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-copiar:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

.btn-copiar:active {
    transform: translateY(0);
}

.btn-copiar.copiado {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
    animation: pulseSuccess 0.5s;
}

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

.detalhes {
    background: rgba(9, 9, 11, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    line-height: 1.8;
}

.detalhes-linha {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: background 0.2s;
}

.detalhes-linha:nth-child(even) {
    background: rgba(39, 39, 42, 0.3);
}

.label {
    font-weight: 600;
    color: var(--purple-static);
}

.valor {
    color: var(--text-secondary);
}

/* Input Group (Validador) */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-cpf {
    flex: 1;
    padding: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1em;
    border: 1px solid var(--border-default);
    border-radius: 12px;
    transition: all 0.3s;
    letter-spacing: 1px;
    background: rgba(39, 39, 42, 0.5);
    color: var(--text-primary);
    outline: none;
}

.input-cpf:focus {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.4),
                0 0 0 4px rgba(168, 85, 247, 0.2);
}

.input-cpf::placeholder {
    color: var(--text-disabled);
}

/* Status de Validação */
.status-valido {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 700;
}

.status-invalido {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 700;
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: var(--text-secondary);
}

.aviso {
    background: rgba(234, 179, 8, 0.1);
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 15px;
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: #fbbf24;
    font-size: 0.9em;
}

.autor {
    color: var(--text-tertiary);
    font-size: 0.9em;
}

.autor p {
    margin: 5px 0;
}

.autor strong {
    color: var(--purple-static);
}

/* Card Glow Breathing */
@keyframes card-glow-breathe {
    0%, 100% {
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.25);
    }
}

.card:hover {
    animation: card-glow-breathe 3s ease-in-out infinite;
}

/* Responsividade */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .tabs {
        flex-direction: column;
    }

    .regioes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cpf-display {
        font-size: 1.8em;
    }

    .cpf-container {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-copiar {
        width: 100%;
    }

    .glass-panel {
        padding: 15px;
        margin: 10px;
        border-radius: 16px;
    }
}
