/* ==========================================================================
   AI Citation Tracker — Frontend Shortcode Styles
   ========================================================================== */

.aict-sc-accordion {
    --aict-source-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e5e2;
    border-radius: 12px;
    overflow: hidden;
}

/* Item */
.aict-sc-item {
    border-bottom: 1px solid #e5e5e2;
}

.aict-sc-item:last-child {
    border-bottom: none;
}

/* Trigger button */
.aict-sc-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
    color: inherit;
    border-radius: 0 !important;
}

.aict-sc-trigger:hover,
.aict-sc-trigger:focus {
    background: #fafaf9 !important;
    border: none !important;
    box-shadow: none !important;
    color: inherit;
}

.aict-sc-open > .aict-sc-trigger,
.aict-sc-open > .aict-sc-trigger:hover {
    background: #fafaf9 !important;
}

/* Query text */
.aict-sc-query-text {
    font-size: 24px;
    font-weight: 400;
    color: #0e0e0c;
    line-height: 1.4;
    flex: 1;
}

/* Right side meta */
.aict-sc-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.aict-sc-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.aict-sc-stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #0e0e0c;
}

.aict-sc-stat-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #a0a09a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Chevron */
.aict-sc-chevron {
    display: flex;
    align-items: center;
    color: #a0a09a;
    transition: transform 0.18s ease;
}

.aict-sc-open > .aict-sc-trigger .aict-sc-chevron {
    transform: rotate(180deg);
}

/* Body */
.aict-sc-body {
    background: #f4f4f2;
    border-top: 1px solid #e5e5e2;
    overflow: hidden;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
}

.aict-sc-body-inner {
    min-height: 0;
    padding: 0 16px;
    transition: padding 0.25s ease;
}

.aict-sc-open > .aict-sc-body {
    grid-template-rows: 1fr;
}

.aict-sc-open > .aict-sc-body .aict-sc-body-inner {
    padding: 16px;
}

/* Platform grid */
.aict-sc-platforms {
    display: flex;
    gap: 12px;
}

/* Platform card */
.aict-sc-platform {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e5e2;
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 0;
}

/* Platform header */
.aict-sc-platform-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0ee;
}

.aict-sc-platform-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.aict-sc-dot-agentai_chatgpt    { background: #1a1a1a; }
.aict-sc-dot-agentai_perplexity { background: #20808d; }
.aict-sc-dot-gemini             { background: #4285f4; }
.aict-sc-dot-claude             { background: #d4a574; }

.aict-sc-platform-name {
    font-size: 16px;
    font-weight: 400;
    color: #343430;
    text-transform: none;
    letter-spacing: 0;
    flex: 1;
}

/* Show all button */
.aict-sc-show-all {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: #70706a;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: background 0.1s, color 0.1s;
}

.aict-sc-show-all:hover {
    background: #f4f4f2;
    color: #0e0e0c;
}

.aict-sc-show-chevron {
    font-size: 13px;
    line-height: 1;
}

/* Sources list */
.aict-sc-sources {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.aict-sc-source {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f4f4f2;
}

.aict-sc-source:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.aict-sc-source:first-child {
    padding-top: 0;
}

.aict-sc-source-rank {
    font-size: var(--aict-source-size);
    color: #a0a09a;
    width: 16px;
    flex-shrink: 0;
    text-align: right;
}

.aict-sc-source-domain {
    font-size: var(--aict-source-size);
    color: #343430;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aict-sc-source-meta {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #0e0e0c;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    cursor: default;
}

.aict-sc-source-meta::after {
    content: attr(data-rate);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: rgba(14, 14, 12, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.9);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.aict-sc-source-meta:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Scan Stats Shortcode
   ========================================================================== */

.aict-sc-scan-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e5e2;
    border-radius: 12px;
}

.aict-sc-scan-stats-label {
    font-size: 24px;
    font-weight: 400;
    color: #0e0e0c;
    line-height: 1.4;
    flex: 1;
}

.aict-sc-scan-stats-meta {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
}

/* ==========================================================================
   Top Domains Shortcode
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap');

.aict-sc-domains {
    border: 1px solid #e5e5e2;
    border-radius: 12px;
    overflow: hidden;
}

.aict-sc-domains-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e2;
}

.aict-sc-domains-title {
    font-size: 24px;
    font-weight: 400;
    color: #0e0e0c;
}

.aict-sc-domains-total {
    font-size: 12px;
    color: #a0a09a;
    background: #f4f4f2;
    border: 1px solid #e5e5e2;
    border-radius: 20px;
    padding: 2px 10px;
}

/* Body layout */
.aict-sc-domains-body {
    display: flex;
    align-items: stretch;
}

/* Chart column */
.aict-sc-domains-chart-col {
    width: 50%;
    flex-shrink: 0;
    padding: 24px 20px;
    border-right: 1px solid #e5e5e2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.aict-sc-domains-chart-wrap {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}

.aict-sc-domains-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}


/* Table column */
.aict-sc-domains-table-col {
    width: 50%;
    flex: none;
    min-width: 0;
}

.aict-sc-domains-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.aict-sc-domains-table thead tr {
    border-bottom: 1px solid #e5e5e2;
}

.aict-sc-domains-table th {
    padding: 14px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #a0a09a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    background: #fff;
}

.aict-sc-domains-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #343430;
    border-bottom: 1px solid #f4f4f2;
    vertical-align: middle;
}

.aict-sc-domains-table tbody tr:last-child td {
    border-bottom: none;
}

.aict-sc-domains-table tbody tr {
    cursor: pointer;
}

.aict-sc-domains-table tbody tr:hover td {
    background: #fafaf9;
}

.aict-sc-col-rank {
    width: 40px;
    color: #a0a09a !important;
    font-size: 16px !important;
}

.aict-sc-col-domain strong {
    font-weight: 400;
    font-size: 16px;
    color: #0e0e0c;
}

.aict-sc-col-platforms {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.aict-sc-domains-table td.aict-sc-col-citations {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    color: #0e0e0c;
    text-align: right;
}

.aict-sc-domains-table th.aict-sc-col-citations {
    text-align: right;
}

.aict-sc-col-first,
.aict-sc-col-last {
    color: #70706a !important;
    white-space: nowrap;
}

/* Platform badges */
.aict-sc-plat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 6px;
    border-radius: 5px;
    color: #70706a;
    background: #f0f0ee;
}

.aict-sc-plat-chatgpt,
.aict-sc-plat-perplexity,
.aict-sc-plat-gemini,
.aict-sc-plat-claude { background: #f0f0ee; color: #70706a; }

/* ==========================================================================
   Competitors Shortcode
   ========================================================================== */

.aict-sc-comp-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aict-sc-comp-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.aict-sc-comp-chart-card,
.aict-sc-comp-rankings-card {
    background: #fff;
    border: 1px solid #e5e5e2;
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

.aict-sc-comp-chart-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.aict-sc-comp-rankings-card {
    width: 33.333%;
    flex-shrink: 0;
}

.aict-sc-comp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.aict-sc-comp-card-title {
    font-size: 24px;
    font-weight: 400;
    color: #0e0e0c;
}

.aict-sc-comp-period-badge {
    font-size: 12px;
    color: #70706a;
    background: #f4f4f2;
    border: 1px solid #e5e5e2;
    border-radius: 20px;
    padding: 3px 10px;
}

.aict-sc-comp-chart-wrap {
    flex: 1;
    min-height: 200px;
    position: relative;
}

/* Rankings table */
.aict-sc-comp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.aict-sc-comp-table thead tr {
    border-bottom: 1px solid #e5e5e2;
}

.aict-sc-comp-table th {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #a0a09a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0 10px;
    text-align: left;
}

.aict-sc-comp-th-right {
    text-align: right !important;
}

.aict-sc-comp-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f4f4f2;
    vertical-align: middle;
}

.aict-sc-comp-table tbody tr:last-child td {
    border-bottom: none;
}

.aict-sc-comp-name {
    font-size: 16px;
    font-weight: 400;
    color: #0e0e0c;
    line-height: 1.3;
}

.aict-sc-comp-domain {
    font-size: 14px;
    color: #a0a09a;
    margin-top: 1px;
}

.aict-sc-comp-citations-cell {
    text-align: right;
    white-space: nowrap;
}

.aict-sc-comp-citations-num {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #0e0e0c;
    line-height: 1;
}

.aict-sc-comp-arrow-up {
    display: none;
}

/* Competitors chart tooltip */
.aict-sc-comp-tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9999;
    background: rgba(12, 12, 11, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

.aict-sc-comp-tooltip.aict-sc-comp-tooltip-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.aict-sc-comp-tt-date {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.aict-sc-comp-tt-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aict-sc-comp-tt-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aict-sc-comp-tt-line {
    width: 16px;
    height: 2px;
    border-radius: 2px;
    flex-shrink: 0;
}

.aict-sc-comp-tt-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    flex: 1;
}

.aict-sc-comp-tt-val {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    margin-left: 8px;
}

/* Chart tooltip */
.aict-chart-tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(14, 14, 12, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 7px 12px 7px 9px;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.aict-chart-tooltip.aict-tooltip-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.aict-chart-tooltip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.aict-chart-tooltip-domain {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.01em;
}

.aict-chart-tooltip-count {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    margin-left: 2px;
}

/* Empty state */
.aict-sc-empty {
    margin: 16px 0 0;
    font-size: 13px;
    color: #a0a09a;
}
