/* ═══════════════════════════════════════════
   Adoption Animals v2 — Public CSS
   ═══════════════════════════════════════════ */
:root {
    --aa-green:     #1a8c6e;
    --aa-green-dk:  #147a5e;
    --aa-green-lt:  #e1f5ee;
    --aa-amber:     #854f0b;
    --aa-amber-lt:  #faeeda;
    --aa-red:       #c0392b;
    --aa-border:    #e5e7eb;
    --aa-bg:        #f9fafb;
    --aa-text:      #111827;
    --aa-muted:     #6b7280;
    --aa-radius:    10px;
    --aa-radius-lg: 14px;
}

/* ── Wrapper ─────────────────────────────── */
.aa-wrap {
    font-family: inherit;
    color: var(--aa-text);
    width: 100%;
    box-sizing: border-box;
}

/* ── Search bar ──────────────────────────── */
.aa-search-bar {
    background: #fff;
    border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius-lg);
    padding: 22px 24px;
    margin-bottom: 16px;
}
.aa-title    { font-size: 1.35rem; font-weight: 700; margin-bottom: 5px; }
.aa-subtitle { font-size: .875rem; color: var(--aa-muted); margin-bottom: 14px; }
.aa-search-row { display: flex; gap: 8px; }
.aa-search-row input {
    flex: 1; padding: 9px 14px;
    border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius);
    font-size: .875rem; outline: none;
    font-family: inherit;
    transition: border-color .15s;
    min-width: 0;
}
.aa-search-row input:focus { border-color: var(--aa-green); }
.aa-search-row button {
    background: var(--aa-green); color: #fff;
    border: none; padding: 9px 20px;
    border-radius: var(--aa-radius);
    font-size: .875rem; cursor: pointer;
    font-family: inherit; white-space: nowrap;
    transition: background .15s;
}
.aa-search-row button:hover { background: var(--aa-green-dk); }

/* ── Mobile chips ────────────────────────── */
.aa-mob-chips {
    display: none;
    gap: 7px; overflow-x: auto;
    padding: 10px 0 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.aa-mob-chips::-webkit-scrollbar { display: none; }
.aa-chip {
    padding: 6px 13px;
    border: 1px solid var(--aa-border);
    border-radius: 20px; font-size: .8rem;
    background: #fff; cursor: pointer;
    white-space: nowrap; font-family: inherit;
    color: var(--aa-text); flex-shrink: 0;
    transition: all .15s;
}
.aa-chip.active { background: var(--aa-green); border-color: var(--aa-green); color: #fff; }

/* ── Body layout ─────────────────────────── */
.aa-body { display: flex; gap: 16px; align-items: flex-start; width: 100%; }

/* ── Sidebar ─────────────────────────────── */
.aa-sidebar {
    width: 200px; flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius-lg);
    padding: 16px;
    position: sticky; top: 20px;
}
.aa-sidebar h3 { font-size: .95rem; font-weight: 700; margin-bottom: 14px; }
.aa-filter-section { margin-bottom: 16px; }
.aa-filter-section > label {
    display: block; font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--aa-muted); margin-bottom: 8px;
}
.aa-radio { margin-bottom: 6px; }
.aa-radio label {
    display: flex; align-items: center; gap: 7px;
    font-size: .8rem; cursor: pointer; color: var(--aa-text);
}
.aa-radio input[type=radio],
.aa-radio input[type=checkbox] { accent-color: var(--aa-green); width: 13px; height: 13px; flex-shrink: 0; }
.aa-clear-btn {
    width: 100%; padding: 7px;
    border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius);
    background: none; font-size: .8rem;
    cursor: pointer; color: var(--aa-muted);
    font-family: inherit; margin-top: 4px;
    transition: border-color .15s;
}
.aa-clear-btn:hover { border-color: var(--aa-green); color: var(--aa-green); }

/* ── Panel wrap ──────────────────────────── */
.aa-panel-wrap { display: flex; flex-direction: column; flex: 1; gap: 0; min-width: 0; overflow: hidden; }

/* ── Main grid area ──────────────────────── */
.aa-main { flex: 1; min-width: 0; }
.aa-main-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 12px;
}
.aa-count { font-size: .8rem; color: var(--aa-muted); }
.aa-sort {
    padding: 6px 10px;
    border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius);
    font-size: .8rem; font-family: inherit;
    background: #fff; color: var(--aa-text);
    cursor: pointer;
}
.aa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

/* ── Loading ─────────────────────────────── */
.aa-loading { grid-column: 1/-1; display: flex; justify-content: center; padding: 48px; }
.aa-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--aa-border);
    border-top-color: var(--aa-green);
    border-radius: 50%;
    animation: aa-spin .7s linear infinite;
}
@keyframes aa-spin { to { transform: rotate(360deg); } }
.aa-no-results { grid-column: 1/-1; padding: 48px; text-align: center; color: var(--aa-muted); font-size: .9rem; }

/* ── Cards ───────────────────────────────── */
.aa-card {
    background: #fff; border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius-lg); overflow: hidden;
    cursor: pointer; transition: transform .15s, box-shadow .15s;
    display: flex; flex-direction: column;
}
.aa-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }
.aa-card.aa-card-active { border-color: var(--aa-green); border-width: 1.5px; }
.aa-card.aa-card-adopted { opacity: .7; cursor: default; }
.aa-card.aa-card-adopted:hover { transform: none; box-shadow: none; }

.aa-card-img { position: relative; height: 140px; overflow: hidden; background: var(--aa-bg); }
.aa-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.aa-card:hover .aa-card-img img { transform: scale(1.05); }
.aa-no-img { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 52px; }

.aa-urgent-badge {
    position: absolute; top: 8px; left: 8px;
    background: var(--aa-amber); color: var(--aa-amber-lt);
    font-size: .68rem; font-weight: 700;
    padding: 3px 8px; border-radius: 20px;
}
.aa-status-dot {
    position: absolute; bottom: 8px; left: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    border: 1.5px solid #fff;
}
.aa-status-available { background: #16a34a; }
.aa-status-pending   { background: #d97706; }
.aa-status-adopted   { background: #6366f1; }

.aa-heart {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px;
    background: rgba(255,255,255,.9);
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
}
.aa-heart svg { width: 14px; height: 14px; fill: none; stroke: #9ca3af; stroke-width: 2; transition: all .15s; }
.aa-heart.liked svg { fill: #ef4444; stroke: #ef4444; }
.aa-heart:hover svg { stroke: #ef4444; }

.aa-card-body { padding: 11px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.aa-card-body h3 { font-size: .95rem; font-weight: 700; }
.aa-card-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: .72rem; color: var(--aa-muted); }
.aa-card-meta span::after { content: '·'; margin-left: 4px; }
.aa-card-meta span:last-child::after { content: ''; }
.aa-card-loc { font-size: .72rem; color: var(--aa-muted); }
.aa-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.aa-tag { font-size: .68rem; padding: 2px 8px; border-radius: 20px; background: var(--aa-green-lt); color: #0f5e47; font-weight: 600; }
.aa-card-btn {
    width: 100%; padding: 8px;
    background: var(--aa-green); color: #fff;
    border: none; border-radius: 8px;
    font-size: .8rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    margin-top: auto; transition: background .15s;
}
.aa-card-btn:hover { background: var(--aa-green-dk); }
.aa-card-btn:disabled { background: var(--aa-border); color: var(--aa-muted); cursor: default; }

/* ── Detail panel (desktop) ──────────────── */
.aa-detail-panel {
    width: 100%;
    background: #fff; border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius-lg);
    overflow: hidden;
    /* JS toggles display, CSS handles the look */
    display: none;
    margin-top: 14px;
}
.aa-detail-panel.open {
    display: block;
}
.aa-detail-inner {
    width: 100%;
    display: flex;
    flex-direction: row;
}

.aa-detail-img {
    position: relative;
    width: 300px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--aa-bg);
    border-radius: var(--aa-radius-lg) 0 0 var(--aa-radius-lg);
    align-self: stretch;
}
.aa-detail-img img { width: 100%; height: 100%; object-fit: scale-down; display: block; }
.aa-detail-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 300px; font-size: 80px; }
.aa-panel-close-btn {
    position: absolute; top: 10px; right: 10px;
    width: 28px; height: 28px;
    background: rgba(255,255,255,.9);
    border: none; border-radius: 50%;
    font-size: 14px; cursor: pointer;
    color: var(--aa-muted); display: flex;
    align-items: center; justify-content: center;
}

.aa-detail-body { padding: 24px 28px; flex: 1; }
.aa-detail-body h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.aa-detail-meta { font-size: .78rem; color: var(--aa-muted); margin-bottom: 4px; }
.aa-detail-loc { display: flex; flex-wrap: wrap; gap: 8px; font-size: .75rem; color: var(--aa-muted); margin-bottom: 14px; }
.aa-detail-loc span::after { content: '·'; margin-left: 8px; }
.aa-detail-loc span:last-child::after { content: ''; }

.aa-detail-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.aa-action-adopt { flex: 1; min-width: 160px; }
.aa-action-visit { flex: 1; min-width: 160px; }
.aa-action-adopt {
    padding: 10px; background: var(--aa-green); color: #fff;
    border: none; border-radius: 8px; font-size: .875rem;
    font-weight: 600; cursor: pointer; font-family: inherit;
    transition: background .15s;
}
.aa-action-adopt:hover { background: var(--aa-green-dk); }
.aa-action-visit {
    padding: 10px; background: #fff;
    border: 1px solid var(--aa-border);
    border-radius: 8px; font-size: .875rem;
    cursor: pointer; font-family: inherit;
    color: var(--aa-text); transition: border-color .15s;
}
.aa-action-visit:hover { border-color: var(--aa-green); color: var(--aa-green); }
.aa-action-ask {
    padding: 8px; background: none; border: none;
    font-size: .8rem; color: var(--aa-muted);
    cursor: pointer; font-family: inherit;
    text-decoration: underline;
}
.aa-adopted-msg { font-size: .85rem; color: #6366f1; padding: 10px; text-align: center; background: #ede9fe; border-radius: 8px; }

.aa-detail-section { margin-bottom: 16px; }
.aa-detail-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--aa-muted); margin-bottom: 10px; }
.aa-divider { height: 1px; background: var(--aa-border); margin: 14px 0; }

.aa-health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.aa-health-item { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.aa-health-item.yes { color: #166534; }
.aa-health-item.no  { color: var(--aa-muted); }
.aa-health-check { font-size: .85rem; font-weight: 700; width: 16px; text-align: center; }

.aa-detail-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.aa-detail-desc { font-size: .82rem; color: var(--aa-muted); line-height: 1.65; }
.aa-detail-desc p { margin-bottom: 8px; }
.aa-steps { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.aa-steps li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: .8rem; color: var(--aa-muted); counter-increment: steps;
}
.aa-steps { counter-reset: steps; }
.aa-steps li::before {
    content: counter(steps);
    min-width: 20px; height: 20px;
    background: var(--aa-green); color: #fff;
    border-radius: 50%; font-size: .72rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── Modal (φόρμες) ──────────────────────── */
.aa-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
}
.aa-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: min(620px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: var(--aa-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.aa-modal-close {
    position: absolute; top: 14px; right: 14px;
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer;
    color: var(--aa-muted); z-index: 1;
}
.aa-modal-body { padding: 28px; }

/* ── Φόρμες ──────────────────────────────── */
.aa-form-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--aa-border); }
.aa-form-header h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.aa-form-header p  { font-size: .875rem; color: var(--aa-muted); }
.aa-form { display: flex; flex-direction: column; gap: 14px; }
.aa-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aa-form-group { display: flex; flex-direction: column; gap: 5px; }
.aa-form-group label { font-size: .8rem; font-weight: 600; }
.aa-form-group input,
.aa-form-group select,
.aa-form-group textarea {
    padding: 9px 13px;
    border: 1px solid var(--aa-border);
    border-radius: 8px; font-size: .875rem;
    font-family: inherit; outline: none;
    transition: border-color .15s;
    color: var(--aa-text); background: #fff;
}
.aa-form-group input:focus,
.aa-form-group select:focus,
.aa-form-group textarea:focus { border-color: var(--aa-green); }
.aa-form-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.aa-form-checks label { display: flex; align-items: center; gap: 6px; font-size: .825rem; cursor: pointer; }
.aa-form-checks input { accent-color: var(--aa-green); }
.aa-form-submit {
    padding: 11px 24px;
    background: var(--aa-green); color: #fff;
    border: none; border-radius: 8px;
    font-size: .9rem; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: background .15s; align-self: flex-start;
}
.aa-form-submit:hover { background: var(--aa-green-dk); }
.aa-form-msg {
    padding: 12px 16px; border-radius: 8px;
    font-size: .875rem; margin-bottom: 8px;
}
.aa-msg-success { background: #dcfce7; color: #166534; }
.aa-msg-error   { background: #fee2e2; color: #991b1b; }

/* ── Mobile panel ────────────────────────── */
.aa-mob-panel {
    display: none;
    position: fixed; inset: 0; z-index: 9990;
    background: #fff; overflow-y: auto;
    flex-direction: column;
}
.aa-mob-panel.open { display: flex; }
.aa-mob-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--aa-border);
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.aa-mob-panel-title { font-size: 1rem; font-weight: 700; }
.aa-mob-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--aa-muted); }
.aa-mob-panel-body { flex: 1; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
    .aa-search-bar { padding: 16px; }
    .aa-title { font-size: 1.1rem; }
    .aa-sidebar { display: none; }
    .aa-mob-chips { display: flex; }
    .aa-detail-panel { display: none; }
    .aa-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .aa-card-img { height: 120px; }
    .aa-no-img { font-size: 40px; }
    .aa-form-row { grid-template-columns: 1fr; }
    .aa-modal { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; border-radius: var(--aa-radius-lg) var(--aa-radius-lg) 0 0; max-height: 90vh; }
    .aa-body { gap: 0; }
}
@media (max-width: 860px) {
    .aa-detail-inner { flex-direction: column; }
    .aa-detail-img { width: 100%; height: 240px; border-radius: var(--aa-radius-lg) var(--aa-radius-lg) 0 0; }
    .aa-health-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
    .aa-grid { grid-template-columns: 1fr; }
}
