/* Herrestad-Persgården custom styles */
:root {
    --hp-secondary: #9b9b9b;
    --hp-border: #646464;
    --hp-hover: #e0e0e0;
    --hp-blue: #007bff;
    --hp-hero-bg: url('/images/gallery/Lekplats.jpg');
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Header */
.site-title {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    border: 2px solid var(--hp-border);
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 4px;
}

/* Navbar */
.navbar {
    background-color: #fff !important;
}

.navbar .nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.6rem 1rem !important;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background-color: var(--hp-hover);
    color: #000 !important;
}

.navbar .dropdown-item:hover {
    background-color: var(--hp-hover);
}

/* Main content */
.site-main {
    padding: 0;
}

/* Hero section (pages with background image) */
.page-hero {
    background-image: var(--hp-hero-bg);
    background-size: cover;
    background-position: center;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    padding: 2rem;
}

.page-hero .content-card {
    background-color: rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    max-width: 800px;
    width: 100%;
}

/* Regular content pages */
.content-page {
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
}

.gallery-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-card img:hover {
    transform: scale(1.02);
}

/* Calendar */
.kalender-dag {
    min-height: 60px;
    vertical-align: top;
    padding: 4px !important;
    font-size: 0.85rem;
}

.kalender-dag.today {
    background-color: #fff3cd;
}

.kalender-dag.other-month {
    color: var(--hp-secondary);
    background-color: #fafafa;
}

.aktivitet-badge {
    display: block;
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Forms */
.form-section {
    max-width: 600px;
}

/* Admin sidebar */
.admin-sidebar {
    width: 220px;
    min-height: 100%;
    background-color: #1e2329;
    color: #fff;
}

.admin-sidebar .nav-link {
    color: #adb5bd !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff !important;
}

.admin-sidebar .nav-section-label {
    color: #495057;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 1rem 3px;
    display: block;
}

.admin-sidebar .nav-link .nav-icon {
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    font-style: normal;
}

.admin-sidebar .nav-link.profile-link {
    color: #6c757d !important;
    font-size: 0.85rem;
}

.admin-sidebar .nav-link.profile-link:hover,
.admin-sidebar .nav-link.profile-link.active {
    color: #adb5bd !important;
}

/* Admin main area */
.admin-main {
    background: #f0f2f5;
    flex: 1;
}

/* Admin topbar (used in Dashboard)
   Negative margin breaks out of AdminLayout's p-4 (1.5rem = Bootstrap p-4) */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -1.5rem -1.5rem 1.5rem;
}

/* Admin stat cards (Dashboard) */
.admin-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: none;
}

.admin-stat-card .stat-label {
    font-size: 0.68rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.admin-stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

.admin-stat-card .stat-context {
    font-size: 0.72rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Admin alert row (Dashboard) */
.admin-alert-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-alert-item {
    flex: 1;
    min-width: 200px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    text-decoration: none;
    color: #856404;
}

.admin-alert-item:hover {
    background: #fff0b3;
    color: #856404;
}

.admin-alert-item.danger {
    background: #f8d7da;
    border-color: #dc3545;
    border-left-color: #dc3545;
    color: #842029;
}

.admin-alert-item.danger:hover {
    background: #f5c6cb;
    color: #842029;
}

.admin-alert-item .alert-arrow {
    margin-left: auto;
    opacity: 0.6;
}

/* ===== Mobilanpassning ===== */

@media (max-width: 767px) {
    .page-hero {
        min-height: 220px;
        padding: 1rem;
    }
    .page-hero .content-card {
        padding: 1rem;
    }
    .content-page {
        padding: 1rem;
    }
    .kalender-dag {
        min-height: 36px;
        padding: 2px !important;
        font-size: 0.7rem;
    }
    .aktivitet-badge {
        font-size: 0.6rem;
        padding: 0 2px;
    }
}

/* Admin mobile topbar */
.admin-mobile-topbar {
    background: #1e2329;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

/* Admin sidebar full-height på desktop */
@media (min-width: 992px) {
    .admin-sidebar.offcanvas-lg {
        min-height: 100%;
        background-color: #1e2329 !important;
    }
}

/* Alerts & validation */
a, .btn-link {
    color: var(--hp-blue);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* Blazor error */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmsiPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after {
    content: "Ett fel uppstod."
}
