/* SUN PF Unified Member & Advertiser Portal Styles */

.sunpf-auth-container {
    max-width: 480px;
    margin: 40px auto 60px;
    padding: 0 15px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.sunpf-auth-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 35px 30px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}

.sunpf-auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.sunpf-auth-icon {
    font-size: 2.2rem;
    display: inline-block;
    margin-bottom: 8px;
}

.sunpf-auth-header h2 {
    font-size: 1.6rem;
    color: #0f172a;
    font-weight: 700;
    margin: 0 0 8px 0;
    font-family: "Roboto Slab", Georgia, serif;
}

.sunpf-auth-header p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.sunpf-auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 25px;
}

.sunpf-auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sunpf-auth-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.sunpf-auth-panel {
    display: none;
}

.sunpf-auth-panel.active {
    display: block;
}

/* Form Elements */
.sunpf-form-group {
    margin-bottom: 18px;
}

.sunpf-form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sunpf-input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sunpf-input-icon {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.7;
}

.sunpf-input-icon-wrap input {
    width: 100%;
    padding: 11px 12px 11px 38px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    background: #f8fafc !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box;
}

.sunpf-input-icon-wrap input:focus, .sunpf-form-group input:focus, .sunpf-form-group textarea:focus {
    border-color: #0284c7 !important;
    background: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.sunpf-form-group input, .sunpf-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f8fafc;
    box-sizing: border-box;
}

.sunpf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.sunpf-form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.sunpf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    cursor: pointer;
}

.sunpf-link-muted {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
}

.sunpf-link-muted:hover {
    text-decoration: underline;
}

.sunpf-btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #0284c7;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 22px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
}

.sunpf-btn-primary:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.sunpf-btn-block {
    width: 100%;
}

.sunpf-btn-accent {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #129656;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(18, 150, 86, 0.25);
    transition: all 0.2s ease;
}

.sunpf-btn-accent:hover {
    background: #0d7c46;
    transform: translateY(-1px);
}

.sunpf-btn-outline {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    color: #0f172a !important;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.sunpf-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.sunpf-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fee2e2;
    color: #b91c1c !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.sunpf-btn-logout:hover {
    background: #fecaca;
}

.sunpf-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 15px;
}
.sunpf-alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}
.sunpf-alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* Dashboard Logged In Layout */
.sunpf-dashboard-wrap {
    max-width: 1240px;
    margin: 30px auto 60px;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.sunpf-dash-header {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 24px 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.sunpf-profile-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sunpf-avatar img {
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: block;
}

.sunpf-profile-text h2 {
    font-size: 1.4rem;
    color: #0f172a;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.sunpf-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sunpf-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.sunpf-badge-email {
    background: #f1f5f9;
    color: #475569;
}
.sunpf-badge-admin {
    background: #fee2e2;
    color: #991b1b;
}
.sunpf-badge-donor {
    background: #dcfce7;
    color: #166534;
}
.sunpf-badge-advertiser {
    background: #e0f2fe;
    color: #0369a1;
}

.sunpf-dash-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Grid Layout */
.sunpf-dash-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 25px;
}

.sunpf-dash-sidebar {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    height: fit-content;
}

.sunpf-dash-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sunpf-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.sunpf-nav-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.sunpf-nav-item.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.sunpf-nav-item.active .nav-count {
    background: #ffffff;
    color: #0284c7;
}

.nav-count {
    margin-left: auto;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.sunpf-tab-content {
    display: none;
}

.sunpf-tab-content.active {
    display: block;
}

/* Stats Cards */
.sunpf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.sunpf-stat-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.bg-green { background: #dcfce7; }
.bg-blue { background: #e0f2fe; }
.bg-amber { background: #fef3c7; }
.bg-purple { background: #f3e8ff; }

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
}

/* Cards & Tables */
.sunpf-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
    margin-bottom: 25px;
    overflow: hidden;
}

.sunpf-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sunpf-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
}

.sunpf-card-body {
    padding: 20px 22px;
}

.sunpf-link-btn {
    background: none;
    border: none;
    color: #0284c7;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.sunpf-link-btn:hover {
    text-decoration: underline;
}

.sunpf-table-wrap {
    overflow-x: auto;
}

.sunpf-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sunpf-data-table th {
    text-align: left;
    padding: 10px 14px;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.sunpf-data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.donation-amount {
    font-weight: 700;
    color: #129656;
}

/* Status Badges */
.badge-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}
.bg-active { background: #dcfce7; color: #166534; }
.bg-expired { background: #fee2e2; color: #991b1b; }
.bg-pending { background: #fef3c7; color: #92400e; }

.badge-loc {
    display: inline-block;
    font-size: 0.78rem;
    background: #f1f5f9;
    color: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.text-danger { color: #dc2626; font-weight: 600; }
.text-warning { color: #d97706; font-weight: 600; }
.text-success { color: #16a34a; font-weight: 600; }
.text-muted { color: #94a3b8; }
.font-bold { font-weight: 700; }

/* Advertisements Grid & Cards */
.sunpf-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.sunpf-tab-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.4rem;
    color: #0f172a;
    font-weight: 700;
}

.sunpf-tab-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.sunpf-ads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.sunpf-ad-manage-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

.ad-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 15px;
}

.ad-loc-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0284c7;
    background: #e0f2fe;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.ad-title {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 700;
}

.sunpf-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.pill-live { background: #dcfce7; color: #166534; }
.pill-expired { background: #fee2e2; color: #991b1b; }
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-warning { background: #ffedd5; color: #c2410c; }

.ad-meta-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.meta-val {
    font-size: 0.92rem;
    color: #1e293b;
    font-weight: 600;
}

.ad-dest-link {
    color: #0284c7;
    text-decoration: none;
    font-weight: 700;
}
.ad-dest-link:hover { text-decoration: underline; }

/* Artwork Previews */
.ad-artwork-preview-area {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.artwork-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.art-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.sunpf-btn-small {
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sunpf-btn-small:hover {
    background: #334155;
}

.artwork-previews-wrap {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.art-preview-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.art-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.art-img-box {
    background: #0f172a;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 75px;
    overflow: hidden;
}

.art-img-box img {
    max-height: 65px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.art-placeholder {
    text-align: center;
    color: #fca5a5;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.btn-art-upload {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.ad-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    text-align: center;
}

.metric-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

.metric-lbl {
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 600;
}

/* Modal */
.sunpf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sunpf-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.sunpf-modal-dialog {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 580px;
}

.sunpf-modal-content {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.sunpf-modal-header {
    background: #f8fafc;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sunpf-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
}

.sunpf-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.sunpf-modal-body {
    padding: 22px;
}

.sunpf-modal-footer {
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sunpf-btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
}

/* Empty Card */
.sunpf-empty-card {
    text-align: center;
    padding: 40px 20px;
}
.sunpf-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.sunpf-empty-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #0f172a;
}
.sunpf-empty-card p {
    color: #64748b;
    margin: 0 0 20px 0;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .sunpf-dash-layout {
        grid-template-columns: 1fr;
    }
    .sunpf-dash-sidebar {
        margin-bottom: 15px;
    }
    .sunpf-dash-nav {
        display: flex;
        overflow-x: auto;
        gap: 6px;
    }
    .sunpf-nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
    .artwork-previews-wrap {
        grid-template-columns: 1fr;
    }
}
