/* Estilos para o Painel de Controle (admin.php) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
}

.admin-container {
    width: 100%;
    max-width: 1000px; 
    margin: 0 auto;
    background-color: #f0f2f5;
    padding: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    min-height: 100vh;
}

.admin-title {
    text-align: center;
    font-size: 1.8rem;
    margin: 1rem 0 2rem 0;
    color: #2c3e50;
    border-bottom: 4px solid #3498db;
    padding-bottom: 1rem;
}

/* --- PREVIEW DO TELÃO (FIXO NO TOPO) --- */
.preview-section {
    background-color: #111;
    padding: 10px;
    border-radius: 0 0 1rem 1rem; /* Arredonda só embaixo quando está no topo */
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    
    /* MÁGICA PARA FIXAR NO TOPO */
    position: sticky;
    top: 0;
    z-index: 100; /* Garante que fique por cima de tudo ao rolar */
    border-bottom: 3px solid #3498db; /* Uma linha para separar do conteúdo que passa por baixo */
}

.preview-wrapper {
    padding-bottom: 56.25%;
    height: 0;
    position: relative;
    overflow: hidden;
    background-color: black;
    border-radius: 0.5rem;
    border: 2px solid #333;
}

#preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    border: 0;
    transform: scale(0.5);
    transform-origin: 0 0;
    pointer-events: none;
}

/* Ajuste de zoom para telas pequenas para o preview não ficar gigante */
@media (max-width: 600px) {
    #preview-iframe {
        width: 400%;
        height: 400%;
        transform: scale(0.25);
    }
}
/* ---------------------------------------- */

/* Seções */
.admin-section {
    background-color: #ffffff;
    border-radius: 0.75rem; 
    padding: 1.5rem;
    margin-bottom: 2rem; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-section h2 {
    font-size: 1.5rem; 
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-left: 5px solid #3498db;
    padding-left: 1rem;
}

/* Grupos de Formulário */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.75rem; 
    color: #2c3e50;
    font-size: 1.1rem; 
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1.25rem; 
    font-size: 1.1rem; 
    border: 1px solid #bdc3c7;
    border-radius: 0.5rem; 
    font-family: inherit;
    transition: border-color 0.3s ease;
    line-height: 1.5; 
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Botões */
.admin-btn {
    width: 100%;
    padding: 1.25rem; 
    font-size: 1.15rem; 
    font-weight: 700;
    border: none;
    border-radius: 0.5rem; 
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    text-align: center;
    text-decoration: none;
}

.btn-primary { background-color: #3498db; color: white; }
.btn-success { background-color: #27ae60; color: white; }
.btn-info    { background-color: #16a085; color: white; }
.btn-danger  { background-color: #e74c3c; color: white; }
.btn-warning { background-color: #f39c12; color: white; }
.btn-secondary { background-color: #95a5a6; color: white; }

.admin-btn i { margin-right: 0.5rem; }

.admin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.admin-btn:active:not(:disabled) { transform: translateY(0); }
.admin-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Texto de Informação */
.info-text {
    background-color: #ecf0f1;
    padding: 1rem;
    border-left: 4px solid #3498db;
    margin-top: 1rem;
    font-size: 1rem;
    color: #2c3e50;
    border-radius: 0.25rem;
}

/* Lista de Avisos Salvos */
.avisos-list { display: flex; flex-direction: column; gap: 1.25rem; }
.aviso-item { background-color: #ecf0f1; border-left: 5px solid #27ae60; padding: 1.25rem; border-radius: 0.5rem; }
.aviso-header { margin-bottom: 0.75rem; }
.aviso-header h3 { margin: 0; color: #2c3e50; font-size: 1.2rem; }
.aviso-text { margin: 0.75rem 0; color: #555; font-size: 1rem; line-height: 1.5; }
.aviso-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.btn-small { padding: 0.8rem; font-size: 0.9rem; width: auto; flex: 1; border-radius: 0.5rem; }

/* Responsividade */
@media (max-width: 480px) {
    .admin-container { padding: 0.5rem; }
    .admin-title { font-size: 1.5rem; }
    .admin-section { padding: 1rem; }
    /* Ajuste para o preview não ocupar a tela toda em celulares muito pequenos */
    .preview-section {
         margin-left: -0.5rem;
         margin-right: -0.5rem;
         border-radius: 0;
    }
}