/**
 * Amilia Activity Page – Styles
 *
 * Layout grid · Filter sidebar · Activity cards · Card stacking · Modal
 * Responsive → amilia-page-responsive.css
 */

/* ================================================================== */
/*  Page Grid                                                         */
/* ================================================================== */

.amilia-page {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 70vh;
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

.amilia-page-sidebar {
    background: var(--amilia-sidebar-bg, #17A7B5);
}

.amilia-page-sidebar .amilia-filters {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.3) transparent;
}
.amilia-page-sidebar .amilia-filters::-webkit-scrollbar { width: 6px; }
.amilia-page-sidebar .amilia-filters::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.3); border-radius: 3px;
}

.amilia-page-content {
    padding: 36px 44px;
    background: #f7f7f8;
    min-width: 0;
}

/* ================================================================== */
/*  Filter Sidebar                                                    */
/* ================================================================== */

.amilia-filters {
    padding: 28px 24px;
    box-sizing: border-box;
}

.amilia-filters-toggle { display: none; }

/* ---- Search ---- */

.amilia-search-wrap { margin-bottom: 28px; }

.amilia-search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: #000;
    box-sizing: border-box;
    outline: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .15s;
}
.amilia-search-input::placeholder { color: #999; }
.amilia-search-input:focus {
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 1px 4px rgba(0,0,0,.08);
}

/* ---- Filter groups ---- */

.amilia-filter-group { margin-bottom: 28px; }
.amilia-filter-group:last-of-type { margin-bottom: 20px; }

.amilia-filter-heading {
    font-size: 17px; font-weight: 700; color: #fff;
    margin: 0 0 8px; padding: 0; line-height: 1.3;
    border: none; text-transform: none; letter-spacing: 0;
}

.amilia-filter-list { list-style: none; margin: 0; padding: 0; }

.amilia-filter-item { margin: 0; padding: 0; }

.amilia-filter-label {
    display: block; padding: 9px 4px; cursor: pointer;
    color: #fff; font-size: 16px; font-weight: 600; line-height: 1.4;
    transition: color .15s, padding-left .15s;
    user-select: none;
}
.amilia-filter-label:hover { color: #F50275; }

.amilia-filter-cb {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

.amilia-filter-item.is-active > .amilia-filter-label {
    color: #F50275; font-weight: 700; padding-left: 10px;
}
.amilia-filter-item.is-active .amilia-filter-text {
    text-decoration: underline; text-underline-offset: 3px;
}

/* ---- Clear button ---- */

.amilia-filter-clear {
    display: inline-block; padding: 11px 32px;
    background: #F50275; border: 2px solid #F50275; color: #fff;
    font-size: 15px; font-weight: 600; border-radius: 50px;
    cursor: pointer; margin-top: 8px;
    transition: background .2s, color .2s, border-color .2s;
    text-decoration: none; letter-spacing: .02em;
}
.amilia-filter-clear:hover {
    background: #fff; border-color: #F50275; color: #F50275;
}

/* ================================================================== */
/*  Results                                                           */
/* ================================================================== */

.amilia-results-status { text-align: center; padding: 32px; color: #666; font-size: 14px; }
.amilia-results-count  { font-size: 13px; color: #888; margin-bottom: 16px; font-style: italic; }
.amilia-results-count:empty { display: none; }

.amilia-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid #ddd; border-top-color: #17A7B5;
    border-radius: 50%; animation: amilia-spin .6s linear infinite;
    vertical-align: middle; margin-right: 6px;
}
@keyframes amilia-spin { to { transform: rotate(360deg); } }

.amilia-results-grid { display: flex; flex-direction: column; gap: 24px; }

/* ================================================================== */
/*  Activity Card                                                     */
/* ================================================================== */

.amilia-card {
    display: flex; flex-direction: row;
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
    transition: box-shadow .25s, transform .15s;
}
.amilia-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.07);
    transform: translateY(-2px);
}

.amilia-card-img {
    flex: 0 0 240px; width: 240px; min-height: 200px;
    overflow: hidden; background: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; box-sizing: border-box;
}
.amilia-card-img img {
    display: block; width: 100%; height: 100%;
    object-fit: contain; border-radius: 6px;
}

.amilia-card-body {
    flex: 1; padding: 22px 28px;
    display: flex; flex-direction: column; min-width: 0;
}

.amilia-card-title {
    font-size: 20px; font-weight: 700; color: #17A7B5;
    margin: 0 0 8px; line-height: 1.25;
}

.amilia-card-meta-row {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 14px; color: #444; line-height: 1.5; margin-bottom: 5px;
}
.amilia-icon { width: 18px; height: 18px; flex-shrink: 0; color: #555; margin-top: 2px; }

.amilia-card-desc {
    font-size: 14px; line-height: 1.65; color: #444; margin: 8px 0 0;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}

.amilia-card-actions {
    margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.amilia-card-btn {
    display: inline-block; padding: 11px 32px;
    background: #F50275; border: 2px solid #F50275;
    color: #fff !important; font-size: 15px; font-weight: 600;
    border-radius: 50px; text-decoration: none !important;
    cursor: pointer; transition: background .2s, color .2s, border-color .2s;
    letter-spacing: .02em;
}
.amilia-card-btn:hover {
    background: #fff; border-color: #F50275;
    color: #F50275 !important; text-decoration: none !important;
}

.amilia-examine-btn {
    display: inline-block; padding: 9px 20px;
    background: transparent; border: 2px solid #999; color: #666;
    font-size: 13px; font-weight: 600; border-radius: 50px;
    cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.amilia-examine-btn:hover { background: #666; color: #fff; border-color: #666; }

.amilia-empty, .amilia-error { text-align: center; padding: 48px 24px; color: #888; font-size: 15px; }
.amilia-error { color: #c0392b; }

/* ================================================================== */
/*  Card Stacking — CodyHouse-inspired sticky stack                   */
/* ================================================================== */

.amilia-stack { position: relative; }

/* ---- Top card with peek layers + clickable badge ---- */

.amilia-stack-peek {
    position: relative;
}

.amilia-stack-peek > .amilia-card {
    position: relative;
    z-index: 2;
}

/* Card shapes peeking behind the top card */
.amilia-stack-peek::before,
.amilia-stack-peek::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
}
.amilia-stack-peek::before {
    top: 10px; left: 8px; right: 8px; bottom: -10px; z-index: 1;
}
.amilia-stack-peek::after {
    top: 20px; left: 16px; right: 16px; bottom: -20px; z-index: 0; opacity: .65;
}

/* Hide peek layers when expanded */
.amilia-stack.is-expanded .amilia-stack-peek::before,
.amilia-stack.is-expanded .amilia-stack-peek::after {
    display: none;
}

/* Clickable badge on top card */
.amilia-stack-badge {
    position: absolute;
    top: 14px; right: 14px; z-index: 3;
    background: #F50275; color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 6px 16px; border-radius: 50px;
    border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(245,2,117,.25);
    transition: background .15s, transform .1s;
}
.amilia-stack-badge:hover { background: #d4015f; transform: scale(1.05); }
.amilia-stack-badge:active { transform: scale(.97); }

/* Hide badge when expanded */
.amilia-stack.is-expanded .amilia-stack-badge { display: none; }

/* ---- Remaining cards: slide down below top card ---- */

.amilia-stack-rest {
    display: none;
    flex-direction: column;
    gap: 24px;
    padding-top: 24px;
}

.amilia-stack.is-expanded .amilia-stack-rest {
    display: flex;
}

/* Last card wrapper is positioned so badge can sit on it */
.amilia-stack-restcard { position: relative; }

/* Collapse badge on the last card */
.amilia-stack-collapse {
    position: absolute;
    bottom: 14px; right: 14px; z-index: 3;
    background: #F50275; color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 6px 16px; border-radius: 50px;
    border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(245,2,117,.25);
    transition: background .15s, transform .1s;
}
.amilia-stack-collapse:hover { background: #d4015f; transform: scale(1.05); }
.amilia-stack-collapse:active { transform: scale(.97); }

/* ================================================================== */
/*  Examine Modal                                                     */
/* ================================================================== */

.amilia-modal-overlay {
    position: fixed; inset: 0; z-index: 999999;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.amilia-modal {
    background: #1e1e2e; color: #cdd6f4; border-radius: 12px;
    width: 100%; max-width: 720px; max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,.4); overflow: hidden;
}
.amilia-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: #181825;
    border-bottom: 1px solid #313244; font-size: 15px;
}
.amilia-modal-close {
    background: none; border: none; color: #cdd6f4;
    font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.amilia-modal-close:hover { color: #f38ba8; }
.amilia-modal-json {
    margin: 0; padding: 20px; overflow: auto;
    font-family: 'JetBrains Mono','Fira Code','Consolas',monospace;
    font-size: 12px; line-height: 1.6;
    white-space: pre-wrap; word-break: break-word;
    color: #a6e3a1; background: #1e1e2e;
}
