/**
 * Admin CSS styles for Add as Preferred Source
 *
 * @since      1.0.0
 *
 * @package    Add_As_Preferred_Source
 * @subpackage Add_As_Preferred_Source/admin/css
 */

/* Settings Page Layout */
.add-as-preferred-source-settings-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
}

.add-as-preferred-source-settings-content {
    flex: 2;
    margin-right: 20px;
    min-width: 500px;
}

.add-as-preferred-source-preview {
    flex: 1;
    min-width: 350px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.add-as-preferred-source-sidebar {
    flex: 1;
    min-width: 250px;
}

/* Mobile Preview */
.preview-container {
    margin: 20px 0;
}

.mobile-device {
    border: 8px solid #333;
    border-radius: 20px;
    padding: 10px 5px;
    margin: 0 auto;
    max-width: 400px;
    background: #fff;
    height: 500px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.preferred-source-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    left: 0;
    right: 0;
    padding: 10px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.banner-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    flex: 1;
    margin-right: 12px;
}

.google-button-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.google-button-image img {
    height: 28px;
    width: auto;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    font-weight: bold;
    color: inherit;
}

/* Demo content */
.demo-content {
    padding: 60px 20px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.demo-content h3 {
    margin-top: 0;
    color: #333;
}

/* Sidebar Box */
.add-as-preferred-source-box {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.add-as-preferred-source-box h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.add-as-preferred-source-box ul {
    margin-left: 20px;
    list-style-type: disc;
}

/* Rating & Support Card */
.adasprso-rate-box {
    background: linear-gradient(160deg, #fffbf0 0%, #ffffff 100%);
    border-color: #f0c040;
    text-align: center;
}

.adasprso-rate-box h3 {
    border-bottom-color: #fae99a;
    color: #3d3000;
}

.adasprso-rate-stars {
    font-size: 26px;
    color: #f0c040;
    letter-spacing: 3px;
    margin-bottom: 6px;
    display: block;
}

.adasprso-rate-link {
    display: inline-block;
    background: #f0c040;
    color: #3d3000;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 4px;
    text-decoration: none;
    margin: 10px 0 4px;
    transition: background-color 0.2s, color 0.2s;
    border: none;
}

.adasprso-rate-link:hover {
    background: #d4a800;
    color: #1a1400;
    text-decoration: none;
}

.adasprso-rate-support {
    margin-top: 12px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.adasprso-rate-support a {
    color: #2271b1;
    text-decoration: underline;
}

.adasprso-rate-support a:hover {
    color: #135e96;
}

@media screen and (max-width: 1100px) {
    .add-as-preferred-source-settings-wrapper {
        flex-direction: column;
    }

    .add-as-preferred-source-settings-content,
    .add-as-preferred-source-preview,
    .add-as-preferred-source-sidebar {
        min-width: 100%;
        margin-right: 0;
    }
}

/* Tabs */
.adasprso-nav-tab-wrapper {
    margin-bottom: 20px !important;
    padding-top: 10px;
}

/* Inline Preview */

.adasprso-inline-preview-box {
    margin-top: 30px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-left: 4px solid #72aee6;
    padding: 15px;
}

.adasprso-inline-preview-box h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.adasprso-inline-preview-container {
    padding: 30px !important;
}

/* Layout 2 Preview Styles */
.adasprso-inline-layout-2 {
    /* Gradient Background */
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;

    /* Flex box */
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 100%;
    box-sizing: border-box;
    width: 100%;
    text-align: left;
}

.adasprso-inline-text-wrapper {
    flex: 1;
    text-align: left;
}

.adasprso-inline-title-mock {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.4;
    margin-bottom: 4px;
}

.adasprso-inline-subtitle-mock {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #515761;
}

.mock-google-btn-wrapper img {
    height: 40px;
    width: auto;
    display: block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ── Analytics Dashboard ────────────────────────────────── */
.aaps-stat-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.aaps-stat-card {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    border-top: 4px solid #ccc;
}

.aaps-stat-impressions { border-top-color: #4f86c6; }
.aaps-stat-clicks      { border-top-color: #3dbd7d; }
.aaps-stat-dismissals  { border-top-color: #f5a623; }
.aaps-stat-ctr         { border-top-color: #9b59b6; }

.aaps-stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: #1d2327;
}

.aaps-stat-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Chart */
.aaps-chart-section {
    margin-top: 30px;
}

.aaps-chart-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #444;
}

.aaps-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.aaps-dot-impressions { background: #4f86c6; }
.aaps-dot-clicks      { background: #3dbd7d; }
.aaps-dot-dismissals  { background: #f5a623; }

.aaps-chart-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    padding: 16px 12px 0;
}

.aaps-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    min-width: 600px;
}

.aaps-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    cursor: default;
}

.aaps-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 1px;
    width: 100%;
    padding-bottom: 4px;
}

.aaps-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: opacity 0.15s;
}

.aaps-chart-col:hover .aaps-bar {
    opacity: 0.75;
}

.aaps-bar-impressions { background: #4f86c6; }
.aaps-bar-clicks      { background: #3dbd7d; }
.aaps-bar-dismissals  { background: #f5a623; }

.aaps-chart-label {
    font-size: 9px;
    color: #999;
    white-space: nowrap;
    transform: rotate(-45deg);
    transform-origin: center;
    margin-top: 6px;
    margin-bottom: 8px;
    height: 28px;
    line-height: 28px;
}

/* ── Category tag-search widget ─────────────────────────────────────────── */
.adasprso-cat-search {
    position: relative;
    max-width: 420px;
}

.adasprso-cat-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-height: 38px;
    padding: 5px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    cursor: text;
    box-sizing: border-box;
}

.adasprso-cat-tags:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.adasprso-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2271b1;
    color: #fff;
    font-size: 12px;
    padding: 3px 6px 3px 8px;
    border-radius: 3px;
    line-height: 1.4;
}

.adasprso-cat-tag-label {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adasprso-cat-tag-remove {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    padding: 0 1px;
    cursor: pointer;
    opacity: 0.75;
    margin: 0;
    min-height: 0;
}

.adasprso-cat-tag-remove:hover {
    opacity: 1;
}

.adasprso-cat-input {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 140px;
    flex: 1;
    font-size: 13px;
    height: 24px;
    background: transparent;
}

.adasprso-cat-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 2px 0 0;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}

.adasprso-cat-option {
    padding: 7px 12px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.adasprso-cat-option:hover {
    background: #f0f6fc;
    color: #2271b1;
}

.adasprso-cat-option.is-selected {
    color: #646970;
    cursor: default;
    background: none;
}

.adasprso-cat-check {
    color: #2271b1;
    font-size: 13px;
    margin-left: 6px;
}

.adasprso-cat-no-results {
    padding: 8px 12px;
    font-size: 13px;
    color: #646970;
    font-style: italic;
}