/**
 * Health Custodian - Advertisement Placement Styles
 * Frontend & Admin Styles
 */

/* ==========================================================================
   1. FRONTEND AD PLACEMENT STYLES
   ========================================================================== */

.hc-ad-placement {
    margin: 1.75rem auto;
    width: 100%;
    clear: both;
}

.hc-ad-wrapper {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: 100%;
}

/* Compliance Badge (ADVERTISEMENT / SPONSORED) */
.hc-ad-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 6px;
    line-height: 1;
}

/* Ad Body */
.hc-ad-body {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    line-height: 0;
}

.hc-ad-code-inner {
    line-height: normal;
    display: inline-block;
    max-width: 100%;
}

.hc-ad-banner-link {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hc-ad-banner-link:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.hc-ad-banner-img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    max-height: 250px;
    object-fit: cover;
}

/* Device Targeting Classes */
@media (max-width: 767.98px) {
    .hc-ad-desktop-only {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hc-ad-mobile-only {
        display: none !important;
    }
}

/* Specific Placements */
.hc-ad-slot-header {
    margin: 1rem auto 1.5rem auto;
    padding: 0 15px;
}

.hc-ad-slot-before_content {
    margin: 0 auto 2rem auto;
}

.hc-ad-slot-in_article {
    margin: 2.25rem auto;
    padding: 1rem 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.hc-ad-slot-after_content {
    margin: 2.5rem auto 1.5rem auto;
}

.hc-ad-slot-sidebar_top {
    margin: 0 auto 1.75rem auto;
}

.hc-ad-slot-sidebar_bottom {
    margin: 1.75rem auto 0 auto;
}

.hc-ad-slot-homepage_break {
    margin: 3.5rem auto;
    padding: 0 15px;
}

/* In-Feed Blog Card Styling */
.hc-ad-feed-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    text-align: center;
    justify-content: center;
    align-items: center;
}

.hc-ad-feed-card .hc-ad-label {
    margin-bottom: 12px;
}

/* Sticky Mobile Bottom Ad */
.hc-sticky-mobile-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    border-top: 1px solid #e2e8f0;
    padding: 6px 12px 8px 12px;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hc-sticky-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.hc-sticky-ad-badge {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.hc-sticky-ad-close {
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.hc-sticky-ad-close:hover {
    color: #0f172a;
}

.hc-sticky-ad-body {
    max-height: 90px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hc-sticky-ad-body img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

/* ==========================================================================
   2. WP ADMIN DASHBOARD STYLES
   ========================================================================== */

.hc-ad-admin-wrap {
    max-width: 1100px;
    margin: 20px 20px 40px 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.hc-ad-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 24px 30px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    margin-bottom: 22px;
}

.hc-ad-badge-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 81, 89, 0.08);
    color: #115159;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.hc-ad-badge-top .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.hc-ad-admin-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.hc-ad-admin-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 13.5px;
}

.hc-persistence-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.hc-pill-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Tabs */
.hc-ad-tab-wrapper {
    margin-bottom: 24px !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.hc-ad-tab-wrapper .nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-right: 6px;
    transition: all 0.15s ease;
}

.hc-ad-tab-wrapper .nav-tab:hover {
    background: #f8fafc;
    color: #115159;
}

.hc-ad-tab-wrapper .nav-tab-active {
    background: #115159 !important;
    color: #ffffff !important;
    border-color: #115159 !important;
}

.hc-ad-tab-wrapper .nav-tab-active .dashicons {
    color: #ffffff !important;
}

/* Slot Cards */
.hc-ad-slots-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.hc-ad-slot-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 26px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hc-ad-slot-card.is-active {
    border-left: 4px solid #115159;
}

.hc-ad-slot-card.is-inactive {
    border-left: 4px solid #cbd5e1;
    opacity: 0.85;
}

.hc-ad-slot-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.hc-slot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hc-slot-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hc-slot-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.hc-slot-status-pill {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.status-active {
    background: #ecfdf5;
    color: #047857;
}

.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.hc-slot-card-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

/* Fields */
.hc-field-group {
    margin-bottom: 16px;
}

.hc-field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.hc-type-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}

.hc-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1e293b;
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.hc-radio-label:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.hc-radio-label input:checked + span {
    font-weight: 700;
    color: #115159;
}

.hc-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.hc-field-col {
    flex: 1;
    min-width: 240px;
}

.hc-code-editor {
    font-family: Consolas, Monaco, monospace !important;
    font-size: 12.5px !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
    padding: 12px !important;
    line-height: 1.5 !important;
}

.hc-highlight-param {
    background: #f8fafc;
    border-left: 3px solid #115159;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-top: 14px;
}

/* Banner Selector */
.hc-banner-preview-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 14px;
}

.hc-banner-thumb-box {
    width: 140px;
    height: 80px;
    background: #e2e8f0;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hc-banner-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.hc-banner-thumb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
}

.hc-banner-thumb-empty .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* Accordion */
.hc-accordion-details {
    margin-top: 18px;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
}

.hc-accordion-summary {
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: #115159;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.hc-accordion-summary:hover {
    color: #0d4148;
}

.hc-accordion-inner {
    padding-top: 14px;
}

.hc-shortcode-helper {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.hc-shortcode-title {
    font-weight: 600;
    color: #475569;
}

/* iOS-Style Switch */
.hc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.hc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hc-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.25s;
    border-radius: 24px;
}

.hc-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.hc-switch input:checked + .hc-slider {
    background-color: #115159;
}

.hc-switch input:checked + .hc-slider:before {
    transform: translateX(20px);
}

/* Save Bar */
.hc-ad-save-bar {
    position: sticky;
    bottom: 20px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 99;
}

.hc-ad-btn-save {
    background: #115159 !important;
    border-color: #0d4148 !important;
    font-weight: 700 !important;
    padding: 6px 24px !important;
    height: auto !important;
    font-size: 14px !important;
}

.hc-ad-btn-save:hover {
    background: #155e67 !important;
}

.hc-ad-save-note {
    font-size: 12.5px;
    color: #64748b;
}

/* Backup Tab */
.hc-backup-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.hc-backup-card {
    display: flex;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px 30px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.hc-backup-card-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #115159;
}

.hc-backup-card-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #0f172a;
}

.hc-backup-card-content p {
    color: #475569;
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.hc-backup-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #334155;
}

.hc-backup-checklist .dashicons-yes-alt {
    color: #10b981;
    margin-right: 4px;
}

.hc-backup-checklist .dashicons-clock {
    color: #64748b;
    margin-right: 4px;
}

.hc-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.hc-tool-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.hc-tool-icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #115159;
    margin-bottom: 10px;
}

.hc-tool-box h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #0f172a;
}

.hc-tool-box p {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 16px;
    min-height: 40px;
}

.hc-tool-btn {
    width: 100%;
    justify-content: center;
}

.hc-file-input {
    width: 100%;
    font-size: 12px;
}

/* ==========================================================================
   DARK THEME OVERRIDES FOR ADS
   ========================================================================== */
[data-theme="dark"] .hc-sticky-mobile-ad {
    background: #131c2e !important;
    border-top: 1px solid #1e293b !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .hc-sticky-ad-badge {
    background: #1a253a !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .hc-sticky-ad-close {
    color: #94a3b8 !important;
}

[data-theme="dark"] .hc-sticky-ad-close:hover {
    color: #f1f5f9 !important;
}

