/**
 * Plugin Pages Styles CONSOLIDADO
 * 
 * Styles for automatically generated plugin pages
 * Inclui estilos consolidados de simple-pages.css
 */

/* ==========================================================================
   Base Page Styles & WordPress Theme Integration
   ========================================================================== */

.ec-page-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ec-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ec-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ec-page-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ec-page-header {
    background: linear-gradient(135deg, var(--ec-primary, #f08000) 0%, var(--ec-secondary, #e67300) 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.ec-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ec-page-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ec-page-main {
    padding: 40px;
}

/* ==========================================================================
   Form Page Styles
   ========================================================================== */

.ec-page-form .ec-page-header {
    background: linear-gradient(135deg, #f08000 0%, #e67300 100%);
}

.ec-form-intro {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 8px;
}

.ec-form-intro h2 {
    color: #1e293b;
    margin-bottom: 15px;
}

.ec-form-intro p {
    color: #64748b;
    font-size: 1.1rem;
}

.ec-form-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ec-form-type-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ec-form-type-card:hover {
    border-color: #f08000;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.ec-form-type-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.ec-form-type-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}

.ec-form-type-description {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.ec-form-type-btn {
    background: #f08000;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ec-form-type-btn:hover {
    background: var(--ec-primary, #f08000);
}

/* ==========================================================================
   Status Page Styles
   ========================================================================== */

.ec-page-status .ec-page-header {
    background: linear-gradient(135deg, var(--ec-success, #10b981) 0%, var(--ec-success-hover, #059669) 100%);
}

.ec-status-checker {
    max-width: 500px;
    margin: 0 auto 40px auto;
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
}

.ec-status-form {
    display: flex;
    gap: 10px;
}

.ec-status-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.ec-status-input:focus {
    outline: none;
    border-color: #f08000;
}

.ec-status-submit {
    background: #f08000;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ec-status-submit:hover {
    background: var(--ec-primary, #f08000);
}

.ec-status-found {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.ec-status-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ec-status-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f08000 0%, #e67300 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.ec-status-info h3 {
    margin: 0 0 5px 0;
    color: #1e293b;
}

.ec-status-info p {
    margin: 0;
    color: #64748b;
}

.ec-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ec-status-pendente {
    background: var(--ec-warning-light, #fef3c7);
    color: var(--ec-warning, #d97706);
}

.ec-status-em-analise {
    background: var(--ec-primary-light, #dbeafe);
    color: var(--ec-primary, #f08000);
}

.ec-status-aprovado {
    background: var(--ec-success-light, #dcfce7);
    color: var(--ec-success, #16a34a);
}

.ec-status-rejeitado {
    background: var(--ec-error-light, #fecaca);
    color: var(--ec-error, #dc2626);
}

/* ==========================================================================
   Portal Page Styles
   ========================================================================== */

.ec-page-portal .ec-page-header {
    background: linear-gradient(135deg, #f08000 0%, #e67300 100%);
}

.ec-portal-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ec-dashboard-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
}

.ec-dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ec-dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.ec-dashboard-icon {
    font-size: 1.5rem;
}

.ec-dashboard-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ec-dashboard-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f08000;
    margin-bottom: 5px;
}

.ec-dashboard-label {
    color: #64748b;
    font-size: 0.9rem;
}

/* ==========================================================================
   Lista Pública Styles
   ========================================================================== */

.ec-page-lista-publica .ec-page-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.ec-lista-filters {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.ec-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.ec-filter-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.ec-filter-group select,
.ec-filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.ec-filter-btn {
    background: #f08000;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    height: fit-content;
}

.ec-lista-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ec-cadastro-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.ec-cadastro-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ec-cadastro-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.ec-cadastro-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f08000 0%, #e67300 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.ec-cadastro-name {
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ec-cadastro-type {
    color: #64748b;
    font-size: 0.9rem;
}

.ec-cadastro-date {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* ==========================================================================
   Estatísticas Page Styles
   ========================================================================== */

.ec-page-estatisticas .ec-page-header {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.ec-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ec-stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ec-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f08000, #f08000, #f59e0b, #10b981);
}

.ec-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
}

.ec-stat-label {
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.ec-stats-chart {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.ec-chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

/* ==========================================================================
   Download Page Styles
   ========================================================================== */

.ec-page-download {
    text-align: center;
    padding: 60px 0;
}

.ec-download-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #f08000;
}

.ec-download-message {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 30px;
}

.ec-download-btn {
    background: #f08000;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ec-download-btn:hover {
    background: var(--ec-primary, #f08000);
}

/* ==========================================================================
   Error States
   ========================================================================== */

.ec-error-state {
    text-align: center;
    padding: 60px 20px;
    background: #fef2f2;
    border-radius: 8px;
    margin: 20px 0;
}

.ec-error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.ec-error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 10px;
}

.ec-error-message {
    color: #6b7280;
    margin-bottom: 20px;
}

.ec-error-actions a {
    display: inline-block;
    background: #f08000;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    margin: 0 5px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.ec-loading {
    text-align: center;
    padding: 40px;
}

.ec-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #f08000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.ec-notification {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    max-width: 450px;
    min-width: 320px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness for notifications */
@media (max-width: 480px) {
    .ec-notification {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: 20px !important;
        max-width: none !important;
        min-width: auto !important;
        z-index: 9999 !important;
    }
}

.ec-notification-success {
    background: #10b981;
    border: 1px solid #059669;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.ec-notification-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.ec-notification-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ec-notification-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #e67300;
}

/* Enhanced notification with actions */
.ec-notification-with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    min-width: 350px;
    max-width: 500px;
}

.ec-notification-with-actions .ec-notification-message {
    flex: 1;
    margin-right: 12px;
    line-height: 1.4;
}

.ec-notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ec-notification-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ec-notification-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.ec-notification-refresh:active {
    transform: translateY(0);
}

.ec-notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ec-notification-close:hover {
    opacity: 1;
}

/* Refresh suggestion notification */
.ec-refresh-suggestion {
    border-left: 4px solid #f59e0b !important;
    background: #fef3c7 !important;
    color: #92400e !important;
}

.ec-notification-refresh-page {
    background: #f59e0b;
    border: 1px solid #d97706;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ec-notification-refresh-page:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ec-notification-refresh-page:active {
    transform: translateY(0);
}

/* Processing indicator for table rows */
.ec-row-processing {
    background-color: rgba(59, 130, 246, 0.05) !important;
    border-left: 3px solid #f08000 !important;
}

.ec-processing-indicator {
    display: inline-block;
    margin-right: 4px;
    animation: spin 1s linear infinite;
    font-size: 12px;
}

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

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.ec-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ec-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.ec-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ec-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ec-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ec-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ec-page-container {
        padding: 0 15px;
    }
    
    .ec-page-title {
        font-size: 2rem;
    }
    
    .ec-page-main {
        padding: 20px;
    }
    
    .ec-form-types {
        grid-template-columns: 1fr;
    }
    
    .ec-dashboard-card,
    .ec-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ec-filters-row {
        grid-template-columns: 1fr;
    }
    
    .ec-lista-grid {
        grid-template-columns: 1fr;
    }
    
    .ec-status-form {
        flex-direction: column;
    }
    
    .ec-modal-content {
        max-width: 95vw;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .ec-page-header {
        padding: 30px 20px;
    }
    
    .ec-page-title {
        font-size: 1.75rem;
    }
    
    .ec-page-description {
        font-size: 1rem;
    }
    
    .ec-stat-number {
        font-size: 2rem;
    }
    
    .ec-form-type-card {
        padding: 20px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ec-page-header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #000;
    }
    
    .ec-modal,
    .ec-notification {
        display: none !important;
    }
    
    .ec-page-container {
        box-shadow: none !important;
        border: none !important;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ec-page {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .ec-page-content {
        background: #374151;
    }
    
    .ec-dashboard-card,
    .ec-cadastro-card,
    .ec-stat-card {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .ec-status-input {
        background: #4b5563;
        border-color: #6b7280;
        color: #f9fafb;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.ec-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ec-focus-visible:focus {
    outline: 2px solid #f08000;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ec-page-container {
        border: 2px solid;
    }
    
    .ec-dashboard-card,
    .ec-cadastro-card {
        border: 2px solid;
    }
}

/* ===== ESTILOS CONSOLIDADOS DE SIMPLE-PAGES ===== */

/* Simple Page Wrapper */
.ec-simple-page-wrapper {
    min-height: 80vh;
    background: #f8fafc;
    padding: 40px 0;
}

.ec-simple-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Common Page Elements from simple-pages */
.ec-simple-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.ec-simple-page-header h1 {
    color: #1f2937;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
}

.ec-simple-page-header p {
    color: #6b7280;
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Unified button styles (eliminando duplicação) */
.ec-button,
.ec-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
}

.ec-button:hover,
.ec-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Reduced motion support - scoped to plugin elements */
@media (prefers-reduced-motion: reduce) {
    .ec-cadastro-form-container *,
    .ec-portal-page *,
    .ec-status-page *,
    .ec-form-container *,
    .ec-modal-container *,
    [class*="ec-"] * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}