/**
 * Xila PlayBook — Frontend Styles
 * File Location: /wp-content/themes/xila/assets/css/playbook.css
 */

/* ---------------------------------------------------
   SIDEBAR / POPUP — PlayBook Header Banner
   Shown at top of PlayBook panel to explain the section
----------------------------------------------------------- */

.xpb-panel-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.xpb-panel-header::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 50%;
}

.xpb-panel-header-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 6px;
}

.xpb-panel-header-title {
    font-size: 15px;
    font-weight: 800;
    color: #78350f;
    letter-spacing: -0.02em;
    margin-bottom: 3px;
}

.xpb-panel-header-sub {
    font-size: 11.5px;
    color: #92400e;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0.85;
}

.xpb-panel-header-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    background: rgba(251, 191, 36, 0.3);
    color: #78350f;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

/* --------------------------------------
   LOADING STATE
----------------------------------- */

.xpb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 12px;
    color: #94a3b8;
    font-size: 13px;
}

.xpb-loader {
    width: 28px;
    height: 28px;
    border: 2px solid #fde68a;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: xpb-spin 0.75s linear infinite;
}

@keyframes xpb-spin {
    to { transform: rotate(360deg); }
}

/* -------------------------
   EMPTY STATE
------------------------------------ */

.xpb-empty {
    text-align: center;
    padding: 36px 20px;
    background: #fffbeb;
    border: 1px dashed #fcd34d;
    border-radius: 12px;
}

.xpb-empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.xpb-empty p {
    font-size: 13px;
    color: #92400e;
    margin: 0;
    line-height: 1.5;
    opacity: 0.8;
}

/* ------------------------------------------
   CATEGORY GROUP
------------------------------------------------  */
.xpb-category {
    margin-bottom: 0;
}

.xpb-cat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    margin-bottom: 6px;
    border-bottom: 1.5px solid #fde68a;
}

.xpb-cat-icon {
    font-size: 13px;
}

.xpb-cat-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex: 1;
}

.xpb-cat-count {
    background: #fde68a;
    color: #78350f;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

/* ----------------------------------------------------
   ACCORDION LIST
----------------------------------------------- */

.xpb-articles-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --------------------------------------------
   ACCORDION ITEM
-------------------------------------- */

.xpb-accordion-item {
    background: #fff;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    overflow: hidden;
    transition: background 0.15s;
}
.xpb-accordion-item:last-child {
    border-bottom: none;
}
.xpb-accordion-item:hover {
    background: #fffef5;
}
.xpb-accordion-item.is-open {
    background: #fffbeb;
    border-bottom-color: #fde68a;
    box-shadow: none;
}
/* ---------------------------------------
   ACCORDION TRIGGER BUTTON
------------------------------------------------- */

.xpb-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 13px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.xpb-accordion-trigger:hover {
    background: #fffbeb;
}

.xpb-accordion-item.is-open .xpb-accordion-trigger {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}

/* Number badge */
.xpb-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.xpb-accordion-item.is-open .xpb-num {
    background: #78350f;
}

/* Text area */
.xpb-trigger-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xpb-trigger-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xpb-accordion-item.is-open .xpb-trigger-title {
    color: #78350f;
    white-space: normal;
}

.xpb-trigger-meta {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right side: read time + chevron */
.xpb-trigger-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.xpb-read-time {
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.xpb-chevron {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.xpb-accordion-item.is-open .xpb-chevron {
    transform: rotate(180deg);
    color: #f59e0b;
}

/* ----------------------------------------------
   ACCORDION BODY
------------------------------------------------- */

.xpb-accordion-body {
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -----------------------------------------------------------
   ARTICLE LOADER (spinner inside accordion body)
--------------------------------------------------------- */

.xpb-article-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.xpb-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #fde68a;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: xpb-spin 0.7s linear infinite;
}

/* ---------------------------------------------
   ARTICLE CONTENT AREA
---------------------------------------------------- */

.xpb-article-content {
    padding: 14px 16px 18px;
    background: #fffef5;
    animation: xpb-fadein 0.25s ease;
}

@keyframes xpb-fadein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.xpb-article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.xpb-article-rt,
.xpb-article-date {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.xpb-open-link {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: #f59e0b;
    text-decoration: none;
    transition: color 0.15s;
}
.xpb-open-link:hover { color: #78350f; }

/* Article Body — rich text */
.xpb-article-body {
    font-size: 13.5px;
    line-height: 1.7;
    color: #334155;
}

.xpb-article-body h1,
.xpb-article-body h2,
.xpb-article-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 16px 0 8px;
    line-height: 1.3;
}

.xpb-article-body h3 {
    font-size: 14px;
}

.xpb-article-body p {
    margin: 0 0 12px;
}

.xpb-article-body ul,
.xpb-article-body ol {
    padding-left: 20px;
    margin: 0 0 12px;
}

.xpb-article-body li {
    margin-bottom: 5px;
}

.xpb-article-body strong {
    font-weight: 700;
    color: #1e293b;
}

.xpb-article-body a {
    color: #f59e0b;
    font-weight: 600;
    text-decoration: none;
}
.xpb-article-body a:hover {
    text-decoration: underline;
    color: #78350f;
}

.xpb-article-body blockquote {
    border-left: 3px solid #fcd34d;
    padding: 8px 12px;
    background: #fffbeb;
    border-radius: 0 8px 8px 0;
    margin: 12px 0;
    font-style: italic;
    color: #92400e;
}

.xpb-article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
}

.xpb-article-body table th {
    background: #fef9c3;
    color: #78350f;
    padding: 8px 10px;
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid #fde68a;
}

.xpb-article-body table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.xpb-article-body table tr:last-child td {
    border-bottom: none;
}

.xpb-no-content {
    color: #94a3b8;
    font-size: 12.5px;
    font-style: italic;
    padding: 10px 0;
}

/* ---------------------------------
   RESOURCE BOXES (Links & PDFs)
--------------------------------------- */

.xpb-resource-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-top: 14px;
}

.xpb-resource-box--links {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.xpb-resource-box--pdfs {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.xpb-resource-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.xpb-resource-box--links .xpb-resource-title { color: #1d4ed8; }
.xpb-resource-box--pdfs  .xpb-resource-title { color: #15803d; }

.xpb-resource-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 12.5px;
}

.xpb-resource-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.xpb-resource-item span {
    flex: 1;
    color: #475569;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xpb-resource-item a {
    font-size: 11.5px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}
.xpb-resource-box--pdfs .xpb-resource-item a { color: #15803d; }
.xpb-resource-item a:hover { text-decoration: underline; }

/* ---------------------------------------
   ARTICLE ACTIONS (Share + Save)
------------------------------------------ */

.xpb-article-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* ----------------------------------------------
   SINGLE EVENT PAGE — PlayBook Tab Panel
------------------------------------------------ */

.xpb-single-wrap {
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
}

.xpb-single-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
    border-bottom: 1.5px solid #fde68a;
    padding: 16px 20px;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.xpb-single-header::after {
    content: '📚';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    opacity: 0.10;
    pointer-events: none;
}

.xpb-single-header-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.xpb-single-header-text {}

.xpb-single-header-title {
    font-size: 17px;
    font-weight: 800;
    color: #78350f;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 4px;
}

.xpb-single-header-desc {
    font-size: 12.5px;
    color: #92400e;
    font-weight: 500;
    line-height: 1.5;
    opacity: 0.9;
}

.xpb-single-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    background: rgba(251, 191, 36, 0.3);
    color: #78350f;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ---------------------------------------------
   SINGLE EVENT — wider accordion (more space)
------------------------------------------------------------- */

.xpb-single-wrap .xpb-trigger-title {
    font-size: 14px;
    white-space: normal;
}

.xpb-single-wrap .xpb-accordion-trigger {
    padding: 13px 18px;
}
.xpb-single-wrap .xpb-article-content {
    padding: 16px 20px 22px;
}

.xpb-single-wrap .xpb-article-body {
    font-size: 14px;
    line-height: 1.75;
}

/* -------------------------------------
   MOBILE POPUP — compact adjustments
-------------------------------------------------------- */

.xila-mobile-popup .xpb-panel-header {
    padding: 12px 14px;
    border-radius: 10px;
}

.xila-mobile-popup .xpb-panel-header-title {
    font-size: 14px;
}

.xila-mobile-popup .xpb-trigger-title {
    font-size: 12.5px;
}

.xila-mobile-popup .xpb-accordion-trigger {
    padding: 10px 11px;
}

.xila-mobile-popup .xpb-article-content {
    padding: 12px 12px 14px;
}

.xila-mobile-popup .xpb-article-body {
    font-size: 13px;
}

/* ------------------------------------------------
   RESPONSIVE
-------------------------------------------------------- */

@media (max-width: 768px) {
    .xpb-trigger-meta { display: none; }
    .xpb-trigger-title { white-space: normal; }
}

/* Single event inline — Open link hide (already removed from PHP) */
.xila-single-playbook-inline .xpb-open-link { display: none !important; }