/**
 * EezyVerse Client Portal — Frontend Styles
 * Clean, modern UI for client site management
 */

/* ── Reset & Base ───────────────────────────── */
.evcp-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
}

.evcp-portal *, .evcp-portal *::before, .evcp-portal *::after {
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────── */
.evcp-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.evcp-header p {
    color: #64748b;
    margin: 0 0 2rem;
}

/* ── Breadcrumb ─────────────────────────────── */
.evcp-breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.evcp-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.evcp-breadcrumb span {
    margin: 0 0.5rem;
}

/* ── Site Cards Grid ────────────────────────── */
.evcp-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.evcp-site-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.evcp-site-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.evcp-site-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.evcp-site-card__header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.evcp-site-card__urls {
    margin-bottom: 1rem;
}

.evcp-url-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.evcp-url-label {
    display: inline-block;
    min-width: 3rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
}

.evcp-url-row a {
    color: #2563eb;
    text-decoration: none;
}

.evcp-url-row a:hover {
    text-decoration: underline;
}

.evcp-site-card__sync {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.evcp-site-card__actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

/* ── Status Badges ──────────────────────────── */
.evcp-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.evcp-status--synced {
    background: #dcfce7;
    color: #166534;
}

.evcp-status--dev-ahead {
    background: #fef3c7;
    color: #92400e;
}

.evcp-status--deploying {
    background: #dbeafe;
    color: #1e40af;
}

.evcp-status--prod-ahead {
    background: #dbeafe;
    color: #1e40af;
}

.evcp-status--rolled-back {
    background: #fef3c7;
    color: #92400e;
}

.evcp-status--error, .evcp-status--failed {
    background: #fee2e2;
    color: #991b1b;
}

.evcp-status--unknown {
    background: #f1f5f9;
    color: #64748b;
}

/* ── Buttons ────────────────────────────────── */
.evcp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.evcp-btn--primary {
    background: #2563eb;
    color: #fff;
}

.evcp-btn--primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.evcp-btn--secondary {
    background: #f1f5f9;
    color: #1a1a2e;
}

.evcp-btn--secondary:hover {
    background: #e2e8f0;
}

.evcp-btn--outline {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.evcp-btn--outline:hover {
    background: #eff6ff;
}

.evcp-btn--danger {
    background: #dc2626;
    color: #fff;
}

.evcp-btn--danger:hover {
    background: #b91c1c;
}

.evcp-btn--block {
    width: 100%;
    margin-bottom: 0.5rem;
}

.evcp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Detail Page ────────────────────────────── */
.evcp-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.evcp-detail-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* ── Tabs ───────────────────────────────────── */
.evcp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.evcp-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.evcp-tab:hover {
    color: #1a1a2e;
}

.evcp-tab--active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ── Cards ──────────────────────────────────── */
.evcp-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.evcp-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.evcp-card__header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.evcp-card__header-row h3 {
    margin: 0;
}

/* ── Overview Grid ──────────────────────────── */
.evcp-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.evcp-overview-grid .evcp-card {
    margin-bottom: 0;
}

/* ── Info Rows ──────────────────────────────── */
.evcp-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.evcp-info-row:last-child {
    border-bottom: none;
}

.evcp-info-label {
    min-width: 5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #64748b;
    text-transform: uppercase;
}

.evcp-info-row a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    word-break: break-all;
}

/* ── Health Dot ─────────────────────────────── */
.evcp-health-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    margin-left: auto;
}

.evcp-health-dot--online {
    background: #22c55e;
}

.evcp-health-dot--offline {
    background: #ef4444;
}

/* ── Actions List ───────────────────────────── */
.evcp-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Settings Table ─────────────────────────── */
.evcp-settings-table {
    width: 100%;
    border-collapse: collapse;
}

.evcp-settings-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.evcp-settings-table td:first-child {
    font-weight: 600;
    color: #64748b;
    width: 40%;
}

/* ── Backup Table ───────────────────────────── */
.evcp-backup-table {
    width: 100%;
    border-collapse: collapse;
}

.evcp-backup-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.evcp-backup-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

/* ── Loading State ──────────────────────────── */
.evcp-loading {
    color: #94a3b8;
    font-size: 0.875rem;
    font-style: italic;
}

/* ── Empty State ────────────────────────────── */
.evcp-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

/* ── Login Prompt ───────────────────────────── */
.evcp-login-prompt {
    text-align: center;
    padding: 3rem;
    background: #f8fafc;
    border-radius: 12px;
}

.evcp-login-prompt a {
    color: #2563eb;
    font-weight: 600;
}

/* ── Confirmation Modal ─────────────────────── */
.evcp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.evcp-modal {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.evcp-modal h3 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.evcp-modal p {
    color: #64748b;
    margin: 0 0 1.5rem;
}

.evcp-modal__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ── Toast Notification ─────────────────────── */
.evcp-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    z-index: 99999;
    animation: evcp-slideIn 0.3s ease;
}

.evcp-toast--success { background: #16a34a; }
.evcp-toast--error { background: #dc2626; }
.evcp-toast--info { background: #2563eb; }

@keyframes evcp-slideIn {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Dashboard (unified tabbed) ────────────── */
.evcp-dashboard__header {
    margin-bottom: 1.5rem;
}

.evcp-dashboard__header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.evcp-dashboard__subtitle {
    color: #64748b;
    margin: 0;
    font-size: 0.9375rem;
}

.evcp-dashboard__tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.evcp-dashboard__tabs::-webkit-scrollbar {
    display: none;
}

.evcp-dashboard__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.evcp-dashboard__tab:hover {
    color: #1a1a2e;
    text-decoration: none;
}

.evcp-dashboard__tab:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    border-radius: 4px 4px 0 0;
}

.evcp-dashboard__tab--active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

.evcp-dashboard__tab .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    line-height: 1rem;
}

.evcp-dashboard__content {
    min-height: 300px;
}

.evcp-deployments-list .evcp-card {
    margin-bottom: 1rem;
}

/* ── Stat Cards Row ─────────────────────────── */
.evcp-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.evcp-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.evcp-stat-card__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #64748b;
    margin-bottom: 0.375rem;
}

.evcp-stat-card__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
}

.evcp-stat-card__value--good { color: #16a34a; }
.evcp-stat-card__value--warn { color: #d97706; }
.evcp-stat-card__value--bad  { color: #dc2626; }

/* ── Tables ────────────────────────────────── */
.evcp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.evcp-table {
    width: 100%;
    border-collapse: collapse;
}

.evcp-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.evcp-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.evcp-table a { color: #2563eb; text-decoration: none; }
.evcp-table a:hover { text-decoration: underline; }

/* ── Empty State (centered with icon) ──────── */
.evcp-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.evcp-empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.evcp-empty-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.evcp-muted {
    color: #94a3b8;
    font-size: 0.875rem;
    font-style: italic;
}

/* ── Small Button Variant ──────────────────── */
.evcp-btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ── Status Badge Extensions ───────────────── */
.evcp-status--active, .evcp-status--publish, .evcp-status--published, .evcp-status--pass {
    background: #dcfce7;
    color: #166534;
}

.evcp-status--inactive, .evcp-status--pending {
    background: #fef3c7;
    color: #92400e;
}

.evcp-status--draft {
    background: #f1f5f9;
    color: #475569;
}

/* ── Brand Card ────────────────────────────── */
.evcp-brand-card__header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.evcp-brand-card__logo {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.5rem;
}

.evcp-brand-card__name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.evcp-brand-card__url {
    color: #2563eb;
    font-size: 0.875rem;
    text-decoration: none;
}

.evcp-brand-card__section {
    margin-bottom: 1.5rem;
}

.evcp-brand-card__section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #64748b;
    margin: 0 0 0.75rem;
}

.evcp-brand-card__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* ── Color Palette ─────────────────────────── */
.evcp-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.evcp-color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    min-width: 72px;
}

.evcp-color-swatch__color {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
}

.evcp-color-swatch__hex {
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #475569;
}

.evcp-color-swatch__name {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Font List ─────────────────────────────── */
.evcp-font-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.evcp-font-list__item {
    background: #f1f5f9;
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #475569;
}

/* ── Platform Grid (AI Content) ────────────── */
.evcp-platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.evcp-platform-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.evcp-platform-item--connected {
    border-color: #86efac;
    background: #f0fdf4;
}

.evcp-platform-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #e2e8f0;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}

.evcp-platform-item--connected .evcp-platform-item__icon {
    background: #bbf7d0;
    color: #166534;
}

.evcp-platform-item__name {
    font-size: 0.875rem;
    font-weight: 500;
    flex-grow: 1;
}

/* ── Progress Bars (SEO) ───────────────────── */
.evcp-progress-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.evcp-progress-item__header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.evcp-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.evcp-progress-bar__fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.evcp-progress-bar__fill--good { background: #22c55e; }
.evcp-progress-bar__fill--warn { background: #f59e0b; }
.evcp-progress-bar__fill--bad  { background: #ef4444; }

/* ── Checklist (SEO) ───────────────────────── */
.evcp-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.evcp-checklist__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.evcp-checklist__item:last-child { border-bottom: none; }

.evcp-checklist__icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.evcp-checklist__item--pass .evcp-checklist__icon {
    background: #dcfce7;
    color: #166534;
}

.evcp-checklist__item--fail .evcp-checklist__icon {
    background: #fee2e2;
    color: #991b1b;
}

.evcp-checklist__label { flex-grow: 1; }

.evcp-checklist__link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.8125rem;
}

.evcp-checklist__link:hover { text-decoration: underline; }

/* ── Notice ────────────────────────────────── */
.evcp-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.evcp-notice--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.evcp-notice .dashicons {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* ── Managed Links (horizontal button row) ── */
.evcp-managed-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
    .evcp-portal { padding: 1rem; }
    .evcp-sites-grid { grid-template-columns: 1fr; }
    .evcp-overview-grid { grid-template-columns: 1fr; }
    .evcp-site-card__actions { flex-direction: column; }
    .evcp-tabs { overflow-x: auto; }
    .evcp-dashboard__tabs { gap: 0; }
    .evcp-dashboard__tab { padding: 0.625rem 1rem; font-size: 0.8125rem; }
    .evcp-detail-header { flex-direction: column; align-items: flex-start; }
    .evcp-stat-row { grid-template-columns: repeat(2, 1fr); }
    .evcp-platform-grid { grid-template-columns: 1fr; }
    .evcp-brand-card__header { flex-direction: column; align-items: flex-start; }
    .evcp-brand-card__actions { flex-direction: column; }
    .evcp-managed-links { flex-direction: column; }
    .evcp-table td { display: block; text-align: left; }
    .evcp-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.6875rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #64748b;
        margin-bottom: 0.125rem;
    }
    .evcp-table thead { display: none; }
    .evcp-table tr {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }
}
