/* =============================================
   RESET / GENERAL
   ============================================= */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sørg for at alle billeder er responsive som standard */
img {
    max-width: 100%;
    height: auto;
}

:root {
    --topbar-h: 200px;
    --route-button-bar-h: 62px;
    /* Default ekstra afstand under topbar for sider uden fast knapbar */
    --content-extra-offset: 60px;
}

/* TEMPORARILY DISABLED TO FIX BOOTSTRAP FLEXBOX CONFLICTS
html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}
*/

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =============================================
   TOPBAR
   ============================================= */
.topbar {
    width: 100%;
    height: var(--topbar-h);
    overflow: hidden;
    position: absolute;
    z-index: 1000;
    margin: 0;
    padding: 0;
}

.topbar-img {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--topbar-h); /* samme højde som content-area bruger */
    object-fit: cover;
    display: block;
    z-index: 1000;
}

/* NY TOPBAR MED LOGO OG GRUPPE-DROPDOWN */
.topbar-new {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--topbar-h);
    background: #f5f5f5;
    border-bottom: 3px solid #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 40px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topbar-logo {
    height: 100%;
    display: flex;
    align-items: center;
}

.topbar-logo img {
    height: 180px;
    width: auto;
    object-fit: contain;
}

.topbar-dropdown-container {
    display: flex;
    align-items: center;
}

.topbar-group-dropdown {
    background: white;
    border: 2px solid #555;
    border-radius: 20px;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 200px;
}

.topbar-group-dropdown:hover {
    background: #f9f9f9;
    border-color: #333;
    transform: translateY(-1px);
}

.topbar-group-dropdown:after {
    content: "\25BC";
    margin-left: 15px;
    font-size: 0.8em;
}

/* Dropdown menu styles */
.topbar-dropdown-container .dropdown-menu {
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #555;
    padding: 10px 0;
    min-width: 300px;
    max-height: 500px;
    overflow-y: auto;
}

.topbar-dropdown-container .dropdown-header {
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #555;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    margin-top: 5px;
}

.topbar-dropdown-container .dropdown-item {
    padding: 12px 25px;
    font-size: 1.1rem;
    transition: background-color 0.2s;
}

.topbar-dropdown-container .dropdown-item.chat-item {
    padding-left: 40px;
    font-size: 1rem;
}

.topbar-dropdown-container .dropdown-item:hover {
    background-color: #e8e8e8;
}

.topbar-dropdown-container .dropdown-item.active {
    background-color: #d0d0d0;
    font-weight: 600;
}

.topbar-dropdown-container .dropdown-item .badge {
    float: right;
    margin-left: 10px;
}

.topbar-dropdown-container .dropdown-divider {
    margin: 8px 0;
}


/* =============================================
   HAMBURGER BUTTON (hidden on desktop)
   ============================================= */
.mobile-menu-btn {
    display: none;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 2rem;
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    z-index: 4150;
    cursor: pointer;
}

/* =============================================
   SIDEBAR (desktop only)
   ============================================= */
.sidebar {
    width: 70px;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    z-index: 1010;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
}

.nav-icon {
    font-size: 1.8rem;
    color: #555;
    padding: 20px 0;
    text-decoration: none;
    display: block;
    text-align: center;
}

.nav-icon:hover {
    color: #003366;
}

/* =============================================
   CONTENT AREA
   ============================================= */
.content-area {
    margin-left: 70px;
    margin-top: calc(var(--topbar-h) + var(--content-extra-offset));
    flex: 1 0 auto;
    width: auto;
}

.routes-content-with-buttons {
    /* Routes-side: brug præcis samme højde som fast knapbar (1:1 offset) */
    --content-extra-offset: var(--route-button-bar-h);
}

.content-area.routes-content-with-buttons {
    margin-top: calc(var(--topbar-h) + var(--route-button-bar-h)) !important;
}

.content-area.routes-content-with-buttons .container {
    margin-top: 0.5rem !important;
}


.content-wrapper {
    margin-right: 20px;
    margin-left: 20px;
}

/* =============================================
   ROUTES: FIXED BUTTON BAR + PRECISE OFFSET
   ============================================= */

.route-button-bar-fixed {
    position: fixed;
    top: var(--topbar-h);      /* lige under header-billedet */
    left: 70px;                /* samme offset som sidebar */
    width: calc(100% - 70px);
    height: var(--route-button-bar-h);
    box-sizing: border-box;
    background: white;
    padding: 10px 16px;
    z-index: 2000;             /* VIGTIGT: over header-billedet */
    display: flex;
    gap: 10px;
    align-items: stretch;
    border-bottom: 1px solid #ddd;
}

.route-button-bar-fixed .btn {
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 16px;
}
/*========================================================================
    ALBUMS STYLING
==========================================================================*/

.album-card {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.album-card:hover {
    transform: scale(1.02);
}

.album-preview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 65px 65px;
    gap: 4px;
    height: 134px;
    overflow: hidden;
    padding: 4px;
}

.album-preview-main {
    grid-column: 1;
    grid-row: 1 / span 2;
    overflow: hidden;
    border-radius: 4px;
    background: #eee;
}

.album-preview-side-top,
.album-preview-side-bottom {
    overflow: hidden;
    border-radius: 4px;
    background: #eee;
}

.album-preview-side-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 13px;
    font-weight: 600;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 12px;
}
.photo-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.1s ease;
}

.photo-thumb:hover {
    transform: scale(1.03);
}

.album-masonry {
    column-count: 5;
    column-gap: 12px;
}

.album-masonry-item {
    break-inside: avoid;
    margin-bottom: 12px;
}

.album-masonry-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.album-masonry-video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    background: #000;
}

.album-actions-dropdown {
    position: relative;
}

.album-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 2500;
}

.album-actions-menu.show {
    display: block;
}

.album-actions-menu a {
    display: block;
    padding: 8px 12px;
    color: #212529;
    text-decoration: none;
}

.album-actions-menu a:hover {
    background: #f8f9fa;
}

.album-edit-modal-content {
    max-width: 980px;
}

.album-edit-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

.album-edit-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
}

.album-edit-photo-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}

.album-edit-photo-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.album-edit-photo-item video {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
    background: #000;
}

.album-edit-photo-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.album-edit-checkmark {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.album-edit-photo-item.selected {
    border-color: #0d6efd;
}

.album-edit-photo-item.selected .album-edit-checkmark {
    display: flex;
}

.photo-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 4200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.photo-lightbox-content {
    position: relative;
    width: min(92vw, 1200px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.photo-lightbox-image {
    width: auto;
    max-width: 100%;
    max-height: calc(92vh - 80px);
    border-radius: 6px;
    object-fit: contain;
    background: #111;
}

.photo-lightbox-video {
    width: min(100%, 1200px);
    max-height: calc(92vh - 80px);
    border-radius: 6px;
    background: #111;
}

.photo-lightbox-close {
    position: absolute;
    top: -8px;
    right: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 34px;
    cursor: pointer;
    line-height: 1;
    z-index: 5;
}

.photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.photo-lightbox-prev {
    left: 10px;
}

.photo-lightbox-next {
    right: 10px;
}

.photo-lightbox-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@media (max-width: 1200px) {
    .album-masonry {
        column-count: 4;
    }
}

@media (max-width: 992px) {
    .album-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .album-masonry {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .album-masonry {
        column-count: 1;
    }

    .photo-lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
}

/* ROUTES: tablet/mobile sidebar-offset override */
@media (max-width: 991px) {
    .route-button-bar-fixed {
        left: 0;
        width: 100%;
    }
}

/*===================================================
MODAL I PHOTOS
====================================================*/

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 6px;
    position: relative;
}

.modal-close-icon {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 24px;
    z-index: 5;
    color: #000;
    line-height: 1;
}

/* ROUTES: compact mobile bar/button sizing */
@media (max-width: 767px) {
    :root {
        --route-button-bar-h: 54px;
        --topbar-h: 120px; /* Lavere topbar på mobil */
    }

    .route-button-bar-fixed {
        padding: 8px 10px;
        gap: 8px;
    }

    .route-button-bar-fixed .btn {
        height: 36px;
        padding: 0 12px;
        font-size: 14px;
    }
    
    /* Mobil styling for ny topbar */
    .topbar-new {
        padding: 0 15px;
        justify-content: flex-end; /* Placer dropdown til højre */
    }
    
    .topbar-logo {
        position: absolute;
        left: 15px;
    }
    
    .topbar-logo img {
        height: 100px;
    }
    
    .topbar-dropdown-container {
        margin-right: 70px; /* Giv plads til hamburger-knappen */
        /* Dropdown er nu til højre, clearance fra logo */
    }
    
    .topbar-group-dropdown {
        font-size: 1rem;
        padding: 10px 20px;
        min-width: 150px;
    }
    
    .topbar-group-dropdown:after {
        margin-left: 8px;
    }
    
    .topbar-dropdown-container .dropdown-menu {
        min-width: 250px;
        max-height: 400px;
        /* Dropdown-menu åbner sig nu fra sin naturlige position */
    }
    
    .topbar-dropdown-container .dropdown-header {
        font-size: 0.85rem;
        padding: 6px 15px;
    }
    
    .topbar-dropdown-container .dropdown-item {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .topbar-dropdown-container .dropdown-item.chat-item {
        padding-left: 35px;
        font-size: 0.9rem;
    }
}


/* =============================================
  Modals styling
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 70px; /* samme offset som sidebar */
    width: calc(100% - 70px);
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}

.modal-content {
    background: white;
    width: 80%;
    max-width: 900px;
    padding: 20px;
    border-radius: 6px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    background-color: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    z-index: 5;
    color: #000;
    line-height: 1;
    padding: 0;
}


/* =============================================
   CARDS  (Bootstrap g-4 gutter handles spacing)
   ============================================= */

/* =============================================
   SLIDE-IN MOBILE MENU (base styles – all sizes)
   ============================================= */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: #003366;
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 4100;
}

.mobile-menu.show {
    left: 0;
}

.mobile-menu a {
    display: block;
    color: white;
    padding: 12px 0;
    text-decoration: none;
    font-size: 1.2rem;
}

.mobile-menu a i {
    margin-right: 10px;
}

/* =============================================
   OVERLAY (base styles – all sizes)
   ============================================= */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 4050;
}

.menu-overlay.show {
    display: block;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    margin-left: 70px;
    flex-shrink: 0;
}

/* =============================================
   TABLET + MOBILE  (≤991px)
   — sidebar hidden, hamburger + slide-in menu
   ============================================= */
@media (max-width: 991px) {
    .sidebar {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .content-area {
        margin-left: 0;
    }

    .footer {
        margin-left: 0;
    }
}

/* Mobil: Centrer hamburger-knap vertikalt i topbaren */
@media (max-width: 767px) {
    .mobile-menu-btn {
        top: calc(var(--topbar-h) / 2);
        transform: translateY(-50%);
        right: 10px;
    }
}

/* =============================================
   MOBILE  (≤767px)
   — topbar flows inline, reduced height
   ============================================= */
@media (max-width: 767px) {
    .topbar {
        position: relative;
        height: auto;
        overflow: visible;
        flex-shrink: 0;
    }
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    transition: 0.2s;
}

.nav-icon.active {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.15);
}

.mobile-menu a.active {
    color: #0d6efd;
    font-weight: bold;
}


.google-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    border: 1px solid #ddd;
    width: 100%;
    margin-bottom: 1rem;
}

.google-calendar > * {
    box-sizing: border-box;
    min-width: 0;
}

.gc-header {
    text-align: center;
    font-weight: 600;
    padding: 10px 0;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 14px;
}

.gc-header:nth-child(7n) {
    border-right: none;
}

.gc-cell {
    min-height: 110px;
    padding: 6px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: visible; /* VIGTIGT: Tillad dropdown at vises */
    min-width: 0;
}

.gc-cell:nth-child(7n) {
    border-right: none;
}

.gc-cell.empty {
    background: #fafafa;
}

.gc-daynum {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.gc-event {
    background: #1976d2;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 3px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-today,
.today-cell,
.day-today {
    background: #fff8e1 !important;
    box-shadow: inset 0 0 0 2px #ffb300;
}

.month-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 1rem;
}

.month-table th,
.month-table td {
    width: 14.2857%;
    min-width: 0;
    border: 1px solid #ddd;
    vertical-align: top;
}

.month-table th {
    text-align: center;
    font-weight: 600;
    padding: 10px 0;
    background: #f5f5f5;
    font-size: 14px;
}

.month-cell {
    background: #fff;
}

.month-empty {
    background: #fafafa;
}

.month-cell-inner {
    min-height: 110px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-width: 0;
    box-sizing: border-box;
}

.month-mobile-list,
.week-mobile-list {
    display: none;
}

.calendar-mobile-item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: visible; /* VIGTIGT: Tillad dropdown at vises */
    background: #fff;
}

.calendar-mobile-meta {
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    padding: 6px 4px;
    text-align: center;
}

.calendar-meta-weekday {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.calendar-meta-day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 2px;
}

.calendar-meta-month {
    font-size: 11px;
    text-transform: uppercase;
    line-height: 1.2;
    margin-top: 2px;
}

.calendar-mobile-body {
    padding: 8px 10px;
    min-width: 0;
}

.calendar-mobile-empty {
    color: #666;
    font-size: 13px;
}

@media (max-width: 767px) {
    .month-table,
    .week-table {
        display: none;
    }

    .month-mobile-list,
    .week-mobile-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .calendar-mobile-body .gc-event,
    .calendar-mobile-body .week-event {
        margin-bottom: 6px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .calendar-mobile-item {
        max-width: 100%;
        overflow: visible; /* VIGTIGT: Tillad dropdown at vises */
    }
}

.week-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.week-table th,
.week-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    vertical-align: top;
    width: 14.2857%;
    min-width: 0;
    overflow: visible;
}

.week-table th {
    background: #f5f5f5;
    text-align: center;
}

.week-event {
    display: block;
    background: #1976d2;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-events-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.home-event-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    background: #f6f6f6;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.home-week-event {
    background: transparent;
    color: #212529;
    border-radius: 0;
    padding: 0;
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.home-week-event + .home-week-event {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e7e7e7;
}

.home-activities-month {
    color: #557287;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 500;
    margin-bottom: 2px;
}

.home-event-date-badge {
    background: #e8efe7;
    border: 1px solid #dbe5da;
    border-radius: 8px;
    padding: 6px 2px;
    color: #6e8c63;
    min-height: 84px;
}

.home-event-date-badge .calendar-meta-weekday {
    font-size: 22px;
    font-weight: 500;
    margin-top: 2px;
}

.home-event-date-badge .calendar-meta-day {
    font-size: 36px;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1;
}

.home-event-content {
    padding: 2px 0 0 14px;
}

.home-activity-line {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    column-gap: 6px;
    line-height: 1.3;
}

.home-activity-line + .home-activity-line {
    margin-top: 2px;
}

.home-activity-icon {
    font-size: 14px;
    color: #97a5b2;
    margin-top: 1px;
}

.home-activity-title {
    color: #17324a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}

.home-activity-meta {
    color: #798998;
    font-size: 12px;
}

.news-preview {
    white-space: pre-line;
    line-height: 1.45;
}

.news-preview.is-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    overflow: hidden;
}

.day-list {
    list-style: none;
    padding-left: 0;
}

.day-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.day-time {
    font-weight: 600;
    margin-right: 8px;
}

.day-title {
    font-size: 14px;
}

.day-today {
    border-radius: 6px;
    padding: 10px;
}
.cal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cal-nav {
    display: flex;
    gap: 10px;
}

.cal-views {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.cal-btn {
    background: #1976d2;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.cal-btn:hover {
    background: #125a9c;
    color: white;
}

/* =============================================
   CALENDAR EVENT ITEMS WITH ICONS
   ============================================= */
.cal-event-item {
    background: #e8f4f8;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 8px 24px 8px 10px;
    margin-bottom: 6px;
    position: relative;
    min-height: 45px;
}

.cal-event-link {
    color: #1976d2;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: block;
    padding-right: 5px;
}

.cal-event-link:hover {
    text-decoration: underline;
    color: #125a9c;
}

.cal-event-past {
    color: #999 !important;
    cursor: default !important;
    pointer-events: none;
    opacity: 0.7;
}

.cal-event-past:hover {
    text-decoration: none !important;
}

.cal-event-actions {
    position: absolute;
    right: 4px;
    top: 3px;
    bottom: 3px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2px;
}

.cal-event-count {
    display: none; /* Skjult som ønsket */
}

.cal-icon-btn {
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 1px 2px;
    text-decoration: none;
    transition: transform 0.1s;
    line-height: 1;
}

.cal-icon-btn:hover {
    transform: scale(1.15);
}

.cal-icon-form {
    display: inline;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.cal-icon-signup,
.cal-icon-signoff {
    cursor: pointer;
}

/* =============================================
   CALENDAR DROPDOWN MENU
   ============================================= */
.cal-dropdown {
    position: relative;
    display: inline-block;
    line-height: 1;
}

.cal-dropdown-toggle {
    font-size: 16px;
    font-weight: bold;
    color: #666;
}

.cal-dropdown-toggle:hover {
    color: #0d6efd;
}

.cal-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    bottom: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 100px;
    z-index: 9999;
    margin-bottom: 2px;
}

.cal-dropdown-menu.show {
    display: block;
}

.cal-dropdown-item {
    display: block;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.cal-dropdown-item:hover {
    background: #f5f5f5;
    color: #000;
}

.cal-dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}

.cal-dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

.cal-dropdown-delete {
    color: #dc3545;
}

.cal-dropdown-delete:hover {
    background: #f8d7da;
    color: #721c24;
}

/* Day view specific styling */
.day-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 24px 10px 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    position: relative;
    min-height: 50px;
}

.day-item-empty {
    padding: 20px 12px;
    text-align: center;
    background: #fafafa;
    border-color: #e0e0e0;
}

.day-empty-text {
    color: #888;
    font-size: 15px;
    font-style: italic;
}

.day-event-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.day-time {
    font-weight: 600;
    font-size: 14px;
    color: #555;
    min-width: 90px;
}

.day-title {
    font-size: 14px;
    color: #1976d2;
    text-decoration: none;
}

.day-title:hover {
    text-decoration: underline;
}

.day-title.cal-event-past {
    color: #999;
    cursor: default;
}

/* For day-item skal actions også være i hjørnet */
.day-item .cal-event-actions {
    position: absolute;
    right: 4px;
    top: 8px;
    bottom: 8px;
}

/* Mobile view adjustments */
@media (max-width: 768px) {
    .cal-event-item {
        min-height: 50px;
        padding-right: 28px;
    }
    
    .cal-icon-btn {
        font-size: 12px;
    }
    
    .day-item {
        min-height: 55px;
        padding-right: 28px;
    }
    
    /* Tilpas topbar til mobil */
    .cal-topbar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .cal-views {
        margin-left: 0;
        justify-content: center;
    }
    
    .cal-nav {
        justify-content: center;
    }
}

/* =============================================
   BOOTSTRAP UTILITY ENFORCEMENT
   Ensure Bootstrap flexbox/spacing utilities work properly
   ============================================= */
.card-body.d-flex {
    display: flex !important;
}

.card-body.flex-column {
    flex-direction: column !important;
}

.mt-auto {
    margin-top: auto !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.align-items-center {
    align-items: center !important;
}

/* Group cards specific styling */
.card.h-100 {
    min-height: 280px !important;
}

.card-body {
    padding: 1.25rem !important;
}

.card-title {
    font-size: 1.1rem !important;
    word-wrap: break-word !important;
}

.card-text {
    word-wrap: break-word !important;
}

/* =============================================
   LOGOUT DROPDOWN MENU
   ============================================= */
.logout-dropdown-container {
    position: relative;
    cursor: pointer;
}

.logout-icon {
    font-size: 1.8rem;
    color: #555;
}

/* =============================================
   ARKIV SYSTEM
   ============================================= */

/* Arkiv Cards */
.archive-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.archive-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
}

.archive-icon {
    font-size: 4rem;
    color: #0d6efd;
    margin-bottom: 1rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 60px;
    margin-top: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #0d6efd, #0dcaf0);
}

.timeline-entry {
    position: relative;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

.timeline-marker {
    position: absolute;
    left: -44px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

.timeline-year {
    font-size: 2.5rem;
    font-weight: bold;
    color: #0d6efd;
    margin: 50px 0 30px;
    padding-left: 20px;
    border-left: 5px solid #0d6efd;
}

.timeline-content {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* FAQ Accordion */
.accordion-button:not(.collapsed) {
    background-color: #e7f3ff;
    color: #0d6efd;
}

/* Search highlight */
.search-highlight {
    background-color: yellow;
    font-weight: bold;
    padding: 0 2px;
}

/* Archive badge */
.badge-archived {
    background-color: #6c757d;
    color: white;
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
}

/* Responsive adjustments for Arkiv */
@media (max-width: 768px) {
    .timeline {
        padding-left: 40px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-marker {
        left: -34px;
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .timeline-year {
        font-size: 1.8rem;
    }
    
    .archive-icon {
        font-size: 3rem;
    }
}

.logout-icon:hover {
    color: #003366;
}

.logout-dropdown {
    position: absolute;
    left: 70px;
    bottom: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    display: none;
    z-index: 2000;
    overflow: hidden;
}

.logout-dropdown.show {
    display: block;
}

.logout-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.logout-option:last-child {
    border-bottom: none;
}

.logout-option i {
    margin-right: 10px;
    font-size: 16px;
}

.logout-option:hover {
    background: #f8f9fa;
    color: #003366;
}

.logout-forget {
    color: #d9534f;
}

.logout-forget:hover {
    background: #fff5f5;
    color: #c9302c;
}

/* Mobile logout styling */
.mobile-logout-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.mobile-logout-section a {
    display: flex;
    align-items: center;
    padding: 12px 0;
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.mobile-logout-section a i {
    margin-right: 10px;
    font-size: 18px;
}

.mobile-logout-section a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.logout-forget-mobile {
    color: white !important;
}

.logout-forget-mobile:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

/* Tablet/Mobile adjustments */
@media (max-width: 768px) {
    .logout-dropdown-container {
        display: none; /* Hidden on mobile, use mobile menu instead */
    }
}

/* =============================================
   GLOBAL MOBILE RESPONSIVE RULES
   ============================================= */
@media (max-width: 767px) {
    /* Sørg for at alle billeder tilpasser sig mobilskærmen */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Forebyg horisontal overflow */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Sørg for at container-fluid ikke overskrider viewport */
    .container-fluid {
        max-width: 100vw;
        overflow-x: hidden;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Sikre at content-area aldrig overskrider */
    .content-area {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .content-wrapper {
        margin-right: 10px;
        margin-left: 10px;
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix Bootstrap row overflow på mobil */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Reducer gap på mobil for at forhindre overflow */
    .row.g-4,
    .row[class*="g-"] {
        --bs-gutter-x: 1rem !important;
        --bs-gutter-y: 1rem !important;
    }
    
    /* Sørg for at kolonner ikke overskrider skærmen */
    [class*="col-"] {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Sørg for at cards aldrig overskrider deres container */
    .card {
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    /* Sørg for at card-body indhold ikke overskrider */
    .card-body {
        overflow: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Sørg for at alle tekstemner i cards kan brydes */
    .card-title,
    .card-text,
    .card-body h1,
    .card-body h2,
    .card-body h3,
    .card-body h4,
    .card-body h5,
    .card-body h6,
    .card-body p,
    .card-body div {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100%;
    }
    
    /* Sørg for at ALLE billeder i cards tilpasser sig korrekt */
    .card img,
    .card-body img,
    .card-img-top,
    .img-fluid,
    img.card-img-top,
    img.img-fluid {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block;
        object-fit: cover;
    }
    
    /* Text wrapping for at undgå overflow */
    .message-content,
    .event-description,
    .calendar-mobile-body,
    p, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Kalenderelementer på mobil */
    .calendar-mobile-item {
        overflow: visible; /* VIGTIGT: Tillad dropdown at vises */
    }
    
    .calendar-mobile-body {
        min-width: 0;
        overflow: visible; /* VIGTIGT: Tillad dropdown at vises */
    }
    
    /* Event tekst skal ikke gå ud over kanten */
    .week-event,
    .gc-event {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

