/*
Theme Name: PIX82 Encurtador
Theme URI: https://seusite.com
Author: PIX82
Author URI: https://seusite.com
Description: Tema de encurtador de URL profissional com verificação de segurança, estatísticas públicas e expiração.
Version: 1.4
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pix82-encurtador
*/

/* =========================================
   1. RESET E GERAL
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f9f9f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   2. CONTAINERS PRINCIPAIS
   ========================================= */
.container-encurtador {
    width: 95%;
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.logo-area {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 10px;
}

.logo-area h1 {
    margin: 0;
    font-size: 2.5rem;
    text-align: center;
    /* Cor é definida dinamicamente no PHP */
}

/* =========================================
   3. FORMULÁRIOS E INPUTS
   ========================================= */
.main-form {
    width: 100%;
}

.input-group-principal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group-superior {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.input-apelido-container {
    width: 100%;
}

input[type="url"],
input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-height: 50px; /* Melhoria para Mobile */
    -webkit-appearance: none;
    line-height: normal;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #999;
}

button[type="submit"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 10px;
    min-height: 50px;
    border: none;
    color: white;
    cursor: pointer;
    transition: opacity 0.3s;
    /* Cor de fundo definida dinamicamente */
}

button[type="submit"]:hover {
    opacity: 0.9;
}

/* =========================================
   4. RESULTADO (LINK GERADO)
   ========================================= */
.resultado {
    background: #f0f0f0;
    padding: 30px 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.input-resultado {
    text-align: center;
    font-weight: bold;
    color: #555;
    background: #fff;
    max-width: 100%;
    cursor: pointer;
}

.btn-copiar-central {
    padding: 10px 30px;
    border-radius: 50px;
    font-size: 16px;
    min-width: 150px;
    display: inline-block;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 5px;
    border: none;
    color: white;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-copiar-central:hover {
    opacity: 0.9;
}

.share-area {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
    width: 100%;
}

.btn-share {
    padding: 10px 20px;
    text-decoration: none;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-share-main {
    transition: opacity 0.3s;
}

#qrcode-container {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* =========================================
   5. ESTATÍSTICAS (HOME DASHBOARD)
   ========================================= */
.stats-container {
    display: grid;
    /* Ajuste para garantir alinhamento no Chrome */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 40px;
}

.stat-card {
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    border-radius: 4px;
    /* Borda esquerda colorida definida via PHP */
}

/* ... restante do código permanece igual ... */

/* =========================================
   6. RODAPÉ
   ========================================= */
.site-footer {
    padding: 40px 0;
    background: #333;
    color: #fff;
    margin-top: auto; /* Empurra footer para baixo se a pag for pequena */
}

.footer-content {
    width: 95%;
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-column h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.footer-column p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #ccc;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #777;
    font-size: 0.8em;
}

/* =========================================
   7. PÁGINA DE ESTATÍSTICAS PÚBLICAS (+)
   ========================================= */
.container-stats {
    max-width: 700px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.stats-header {
    padding: 20px;
    text-align: center;
    color: #fff;
    /* Fundo definido via PHP */
}

.stats-body {
    padding: 30px;
}

.stats-row {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.stats-row:last-child {
    border: none;
}

.stats-label {
    display: block;
    font-size: 0.85em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stats-value {
    font-size: 1.1em;
    color: #333;
    word-break: break-all;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.big-number {
    font-size: 2em;
    font-weight: bold;
}

.btn-home {
    display: block;
    text-align: center;
    margin-top: 20px;
    text-decoration: none;
    color: #888;
    font-size: 0.9em;
    transition: color 0.3s;
}

.btn-home:hover {
    color: #555;
}

/* =========================================
   8. PÁGINA DE ERRO (404 / EXPIRADO)
   ========================================= */
.error-container {
    text-align: center;
    padding: 60px 20px;
    flex: 1;
}

.error-code {
    font-size: 80px;
    font-weight: bold;
    margin: 0;
    line-height: 1;
    opacity: 0.8;
}

.error-message {
    font-size: 24px;
    color: #444;
    margin: 20px 0 30px;
}

.aviso-erro {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #fcc;
}

/* =========================================
   9. RESPONSIVIDADE
   ========================================= */
@media (min-width: 600px) {
    .input-group-superior {
        flex-wrap: nowrap;
    }
    
    .input-group-superior input {
        flex: 1;
    }
    
    button[type="submit"] {
        width: auto;
        margin-top: 0;
        min-width: 150px;
    }
}

@media (max-width: 500px) {
    .error-code {
        font-size: 60px;
    }
    
    .error-message {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container-encurtador {
        padding: 20px;
        width: 100%;
        margin: 20px auto;
    }
}