/**
 * Projetos Core - Estilos Frontend com Herança do Tema
 * Este CSS foi projetado para herdar automaticamente cores, fontes e estilos
 * do tema WordPress ativo (VW One Page Pro / Ibtana).
 * 
 * Estratégia:
 * - Usar classes nativas do WordPress e Bootstrap quando possível
 * - Definir apenas estrutura/layout, não cores/fontes
 * - Permitir que o tema defina a aparência visual
 */

/* ==========================================================================
   1. LAYOUT PRINCIPAL
   ========================================================================== */

.pc-admin-wrapper,
.pc-profile-wrapper,
.pc-dashboard-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   2. TIPOGRAFIA
   Herda do tema, apenas define hierarquia
   ========================================================================== */

.pc-profile-wrapper h3,
.pc-admin-wrapper h3,
.pc-dashboard-wrapper h3 {
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.pc-profile-wrapper h3:first-child,
.pc-admin-wrapper h3:first-child {
    margin-top: 0;
}

/* ==========================================================================
   3. FORMULÁRIOS - Estrutura e Layout
   Herda estilos de input do tema
   ========================================================================== */

.pc-form-row {
    margin-bottom: 20px;
}

.pc-form-row label,
.pc-flex-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.pc-form-row small {
    display: block;
    margin-top: 5px;
    opacity: 0.7;
}

/* Inputs - apenas width, altura herda do tema */
.pc-input,
.pc-select,
input[type="text"].pc-input,
input[type="email"].pc-input,
input[type="password"].pc-input,
textarea.pc-input {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    /* Herda padding, border, font-size do tema */
}

/* Garante que inputs do WordPress também funcionem */
.pc-profile-wrapper input[type="text"],
.pc-profile-wrapper input[type="email"],
.pc-profile-wrapper input[type="password"],
.pc-profile-wrapper textarea,
.pc-admin-wrapper input[type="text"],
.pc-admin-wrapper input[type="email"],
.pc-admin-wrapper select {
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   4. LAYOUTS RESPONSIVOS
   ========================================================================== */

.pc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.pc-flex-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.pc-flex-row>div {
    flex: 1;
}

@media (max-width: 768px) {
    .pc-grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pc-flex-row {
        flex-direction: column;
        gap: 15px;
    }

    .pc-admin-wrapper,
    .pc-profile-wrapper,
    .pc-dashboard-wrapper {
        margin: 20px 10px;
        padding: 20px;
    }
}

/* ==========================================================================
   5. BOTÕES - Herdam do Tema WordPress/Bootstrap
   ========================================================================== */

.pc-btn,
.pc-admin-wrapper .button,
.pc-admin-wrapper button[type="submit"],
.pc-profile-wrapper .button,
.pc-profile-wrapper button[type="submit"],
.pc-dashboard-wrapper .button,
.pc-dashboard-wrapper button[type="submit"] {
    /* Força herança completa dos estilos do tema */
    display: inline-block !important;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Remove estilos que possam sobrepor o tema */
    border: inherit;
    background: inherit;
    color: inherit;
    padding: inherit;
    font-size: inherit;
    font-weight: inherit;
    border-radius: inherit;
}

/* Garante que botões primários herdem do tema */
.pc-admin-wrapper .button-primary,
.pc-profile-wrapper .button-primary,
.pc-dashboard-wrapper .button-primary {
    background: inherit !important;
    border-color: inherit !important;
    color: inherit !important;
}

/* Espaçamento entre botões */
.pc-profile-wrapper .button,
.pc-admin-wrapper .button {
    margin-right: 10px;
}

/* ==========================================================================
   6. NOTIFICAÇÕES/MENSAGENS
   Usa estilos do WordPress admin
   ========================================================================== */

.pc-notice {
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid;
    background: #f9f9f9;
}

.pc-notice.notice-success {
    border-left-color: #46b450;
    background: #ecf7ed;
}

.pc-notice.notice-error {
    border-left-color: #dc3232;
    background: #fef7f7;
}

.pc-notice.notice-warning {
    border-left-color: #ffb900;
    background: #fff8e5;
}

.pc-notice.notice-info {
    border-left-color: #00a0d2;
    background: #e5f5fa;
}

/* Mensagens inline junto aos campos - ALTA PRIORIDADE */
.pc-profile-wrapper .pc-field-error,
.pc-admin-wrapper .pc-field-error,
.pc-field-error {
    display: block !important;
    padding: 12px 15px !important;
    margin-bottom: 10px !important;
    border: 2px solid #dc3232 !important;
    border-left: 5px solid #dc3232 !important;
    background: #fff5f5 !important;
    color: #c92a2a !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(220, 50, 50, 0.15) !important;
}

.pc-profile-wrapper .pc-field-error::before,
.pc-admin-wrapper .pc-field-error::before,
.pc-field-error::before {
    content: '⚠️ ' !important;
    font-weight: bold !important;
    font-size: 16px !important;
}

/* Campos com erro - ALTA PRIORIDADE */
.pc-profile-wrapper input.has-error,
.pc-admin-wrapper input.has-error,
.pc-input.has-error,
input.has-error {
    border: 2px solid #dc3232 !important;
    background: #fff5f5 !important;
    outline: none !important;
}

.pc-profile-wrapper input.has-error:focus,
.pc-admin-wrapper input.has-error:focus,
input.has-error:focus {
    border: 2px solid #dc3232 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.2) !important;
    outline: none !important;
}

/* Melhorar visibilidade das opções selecionadas no select múltiplo */
select[name="page_ids[]"] option.selected-page {
    background: #e3f2fd;
    font-weight: 600;
    color: #1976d2;
}

select[name="page_ids[]"] option:checked {
    background: #2196f3 !important;
    color: white !important;
}

/* ==========================================================================
   7. DOCUMENTOS E UPLOADS
   ========================================================================== */

.pc-doc-box {
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.pc-doc-box label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.pc-doc-current {
    margin: 10px 0;
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #0073aa;
}

.pc-doc-current a {
    text-decoration: none;
    color: #0073aa;
}

.pc-doc-current a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   8. TABELAS (Admin)
   Herda estilos do WordPress .wp-list-table
   ========================================================================== */

.pc-admin-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.pc-admin-wrapper table th,
.pc-admin-wrapper table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.pc-admin-wrapper table th {
    background: #f5f5f5;
    font-weight: 600;
}

.pc-admin-wrapper table tr:hover {
    background: #f9f9f9;
}

/* ==========================================================================
   9. DASHBOARD
   ========================================================================== */

.pc-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.pc-dash-card {
    padding: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pc-dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pc-dash-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* ==========================================================================
   10. UTILIDADES
   ========================================================================== */

.pc-text-center {
    text-align: center;
}

.pc-text-right {
    text-align: right;
}

.pc-mt-20 {
    margin-top: 20px;
}

.pc-mb-20 {
    margin-bottom: 20px;
}

hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #e0e0e0;
}

/* ==========================================================================
   11. COMPATIBILIDADE COM BOOTSTRAP (Tema VW One Page Pro)
   ========================================================================== */

/* Se o tema tem Bootstrap, garante que funciona */
.pc-profile-wrapper .form-control,
.pc-admin-wrapper .form-control {
    width: 100%;
}

/* Garante que o container do Bootstrap não quebre o layout */
.pc-profile-wrapper .container,
.pc-admin-wrapper .container {
    max-width: 100%;
    padding: 0;
}

/* ==========================================================================
   12. ACESSIBILIDADE
   ========================================================================== */

/* Focus states para keyboard navigation */
.pc-profile-wrapper input:focus,
.pc-profile-wrapper textarea:focus,
.pc-profile-wrapper select:focus,
.pc-admin-wrapper input:focus,
.pc-admin-wrapper textarea:focus,
.pc-admin-wrapper select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Screen reader only */
.pc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.pc-btn,
.pc-btn-primary-large,
.pc-btn-secondary {
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    /* Se o Ibtana não estilizar <button>, isto garante o mínimo */
    padding: 10px 20px;
    border-radius: 4px;
}

/* * Listas e Tabela de Resumo 
 */
.pc-list {
    list-style: none;
    padding: 0;
}

.pc-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pc-table {
    width: 100%;
    border-collapse: collapse;
}

.pc-table th,
.pc-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* * Cards / Contentores
 * Fundo branco suave para separar o conteúdo do fundo do site
 */
.pc-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 5px;
}

/* * Notificações (Feedback)
 * Cores essenciais para indicar estado (Erro vs Sucesso)
 */
.pc-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #ccc;
    background: #fcfcfc;
}

.pc-notice.notice-success {
    border-color: #46b450;
    color: #2e5c31;
}

.pc-notice.notice-error {
    border-color: #dc3232;
    color: #8a2424;
}

/* * Uploads
 */
.pc-file-missing {
    color: #d63638;
    font-weight: bold;
}

.pc-file-exists {
    color: #46b450;
    font-weight: bold;
}

/* Responsivo */
@media (max-width: 768px) {
    .pc-grid-2 {
        grid-template-columns: 1fr;
    }

    .pc-flex-row {
        flex-direction: column;
        align-items: stretch;
    }
}