/* --- Base Typography & Palette --- */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-subtle: #eff6ff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-app: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1140px;
}

/* --- Clean Navbar --- */
.app-navbar {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main) !important;
    display: inline-flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.navbar-brand img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
    font-weight: 500;
    font-size: 0.925rem;
    color: var(--text-muted) !important;
    padding: 0.55rem 0.85rem !important;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
    color: var(--text-main) !important;
    background-color: var(--primary-subtle);
}

.nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0.85rem;
    right: 0.85rem;
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
}

.nav-link.admin-link {
    color: var(--text-muted) !important;
}

.nav-link.admin-link.active {
    color: var(--text-main) !important;
}

.nav-link.admin-link.active::after {
    background-color: var(--text-main);
}

/* --- Hero Section --- */
.hero-section {
    padding: 3rem 1rem 2.5rem;
}

.hero-title {
    font-weight: 700;
    font-size: 2.25rem;
    line-height: 1.25;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.75rem;
    }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 620px;
    margin: 0 auto;
}

/* --- Action Cards --- */
.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.action-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.05);
}

.action-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.icon-blue {
    background-color: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid #dbeafe;
}

.icon-slate {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border);
}

/* --- Step Cards --- */
.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
    height: 100%;
}

.step-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary);
    background-color: var(--primary-subtle);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-dark {
    background-color: #0f172a;
    border-color: #0f172a;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.btn-dark:hover {
    background-color: #1e293b;
    border-color: #1e293b;
}

.btn-outline-secondary {
    border-radius: 8px;
    font-weight: 600;
}

/* --- Media / Image Cards --- */
.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--surface);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.card-img-top {
    width: 100%;
    object-fit: contain;
    background-color: #f8fafc;
}

/* --- Universal Modern Item Cards --- */
.item-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.02);
    border-color: var(--border-hover);
}

.item-card-img-wrap {
    height: 220px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.item-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.25s ease;
}

.item-card:hover .item-card-img-wrap img {
    transform: scale(1.04);
}

.item-card-expand-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.725rem;
    padding: 3px 8px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.item-card:hover .item-card-expand-badge {
    opacity: 1;
}

/* Integrated Score Bar */
.card-score-bar {
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
}

.card-score-item {
    flex: 1;
    text-align: center;
}

.card-score-label {
    font-size: 0.685rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.card-score-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.score-breakdown-strip {
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 0.775rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Finder Contact Box */
.finder-contact-box {
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}

.finder-contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* --- Content / Markdown Formatting --- */
.ai-description-content p:last-child,
.card-text p:last-child {
    margin-bottom: 0;
}

.ai-description-content ul,
.card-body ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.ai-description-content li,
.card-body li {
    margin-bottom: 0.25rem;
}

/* --- Admin Dashboard Specific --- */
.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.admin-stat-label {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.admin-stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.card-desc-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.admin-table {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

.admin-table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
    background-color: #f1f5f9;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.admin-thumb:hover {
    opacity: 0.85;
}

.admin-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.filter-tab-btn {
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    transition: all 0.15s ease;
}

.filter-tab-btn:hover {
    color: var(--text-main);
    background-color: #f1f5f9;
}

.filter-tab-btn.active {
    color: var(--text-main);
    background-color: #e2e8f0;
    font-weight: 600;
}

/* --- Footer --- */
.app-footer {
    margin-top: auto;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}
