/* SafeSight Custom Styles */

/* Main Logo Spacing */

/* 1) Make the h1 inner span behave like a brand unit */
section.hero.is-primary.is-medium h1 > span {
  display: inline-flex;
  align-items: baseline;       /* align icon exactly with text baseline */
  gap: 0.75em;                  /* clean spacing between icon and wordmark */
  white-space: nowrap;         /* keep icon + SafeSight together */
}

/* 2) Control Bulma's .icon.is-large wrapper */
section.hero.is-primary.is-medium h1 > span > span.icon.is-large {
  font-size: 1em;           /* scale icon relative to heading */
  line-height: 1;              /* eliminate extra top/bottom padding */
}

/* 3) Nudge Font Awesome *solid* icon to sit on the baseline */
section.hero.is-primary.is-medium h1 > span > span.icon.is-large > i.fa-solid {
  vertical-align: -0.1em;      /* drop slightly to align perfectly */
  transform: translateY(0.06em);
  line-height: 1;              /* avoids inner glyph misalignment */
}

/* 4) Optional: if the wordmark is a second span */
section.hero.is-primary.is-medium h1 > span > span:not(.icon) {
  font-weight: 700;
  line-height: 1;
}

/* Main Content Spacing */
main {
    min-height: calc(100vh - 52px - 120px); /* viewport - navbar - footer */
}

/* Notification Bell */
#notification-dropdown .icon {
    position: relative;
}

#notification-count:empty {
    display: none;
}

/* HTMX Loading Indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3273dc;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File Cards */
.file-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.file-card .card-image {
    height: 200px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card .card-image img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.file-card .file-type-icon {
    font-size: 4rem;
    color: #dbdbdb;
}

/* Organization Badge */
.org-badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

/* Map Container */
.map-wrapper {
    position: relative;
    height: 400px;
    margin-bottom: 1rem;
}

.map-wrapper.is-fullscreen {
    height: calc(100vh - 200px);
}

/* Access Log Table */
.access-log-table {
    font-size: 0.875rem;
}

.access-log-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Notification Items */
.notification-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: #f5f5f5;
}

.notification-item.is-unread {
    background-color: #eef6fc;
    font-weight: 600;
}

.notification-item.is-unread::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #3273dc;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state .icon {
    font-size: 4rem;
    color: #dbdbdb;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #7a7a7a;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #b5b5b5;
}

/* Filter Sidebar */
.filter-sidebar {
    position: sticky;
    top: 1rem;
}

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3273dc;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #7a7a7a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sharing Policy Cards */
.policy-option {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.policy-option:hover {
    border-color: #3273dc;
}

.policy-option.is-selected {
    border-color: #3273dc;
    background-color: #eef6fc;
}

.policy-option .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Modal Overlay for HTMX */
.modal.is-active {
    z-index: 40;
}

/* Responsive Tables */
@media screen and (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }
}

/* ========================================
   RESPONSIVE LAYOUT FIXES
   ======================================== */

/* Fix for title/subtitle overlap - Apply to all screen sizes */
.level-item .subtitle {
    margin-top: 0 !important;
}

/* Tablet and Mobile - Stack sidebar */
@media screen and (max-width: 1023px) {
    /* Disable sticky on mobile/tablet */
    .filter-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }

    /* Full-width file grid on smaller screens */
    #file-grid .columns {
        margin: 0 !important;
    }

    /* Adjust page header for mobile - Let Bulma handle the level layout */
    .level {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .level-left,
    .level-right {
        margin-bottom: 1rem;
        width: 100%;
    }

    /* Ensure title and subtitle stack properly - override Bulma's negative margin */
    .level-item .title {
        margin-bottom: 0.5rem !important;
    }

    .level-item .subtitle {
        margin-top: 0 !important;  /* Override Bulma's -1.25rem negative margin */
        margin-bottom: 1rem !important;
    }

    /* Additional specificity for subtitle inside level */
    .level .level-left .subtitle:not(:last-child) {
        margin-top: 0 !important;
    }
}

/* Mobile Specific - Smaller spacing */
@media screen and (max-width: 768px) {
    /* Reduce padding on mobile */
    .section {
        padding: 1.5rem 0.75rem;
    }

    /* Smaller titles on mobile */
    .title {
        font-size: 1.5rem !important;
    }

    .subtitle {
        font-size: 1rem !important;
    }

    /* Stack buttons vertically on mobile */
    .buttons.has-addons {
        flex-direction: column;
    }

    .buttons.has-addons .button {
        width: 100%;
        border-radius: 4px !important;
        margin-bottom: 0.5rem;
    }

    /* Adjust filter sidebar on mobile */
    .filter-sidebar {
        padding: 1rem;
    }

    .filter-sidebar .title {
        font-size: 1.25rem !important;
    }

    /* Smaller empty state on mobile */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state .icon {
        font-size: 3rem;
    }
}

/* File Cards - Responsive Grid */
@media screen and (max-width: 768px) {
    /* Single column on mobile */
    .file-card {
        margin-bottom: 1rem;
    }
}

@media screen and (min-width: 769px) and (max-width: 1023px) {
    /* Two columns on tablet */
    .file-card {
        margin-bottom: 1rem;
    }
}

/* Map Adjustments for Mobile */
@media screen and (max-width: 768px) {
    .map-wrapper {
        height: 300px;
    }

    .map-wrapper.is-fullscreen {
        height: calc(100vh - 300px);
    }
}

/* Button Loading State */
button.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Navbar Z-Index Fix - Ensure navbar dropdowns appear above maps and modals */
.navbar {
    z-index: 3000;
}

.navbar-menu {
    z-index: 3000;
}

.navbar-dropdown {
    z-index: 3001;
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    /* Placeholder for dark mode styles */
}
