.scrollup {
    width: 50px;
    height: 50px;
    position: fixed;
    bottom: 30px;
    right: 3px;
    display: none;
    text-indent: -9999px;
    background: url("icon_top_tiny_black.png") no-repeat;
    z-index: 1000; /* Ensure it's above other content */
}

/* Reset any problematic default styles */

/* Only target specific problematic elements - removed blanket selector */

.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    background-color: white;
    z-index: 30;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 56px; /* Set fixed height for navbar */
    min-height: 56px !important; /* Override Bulma's default min-height */
}

/* System notifications container */
#system-notifications {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    max-width: 80%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification-card {
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-bottom: 0 !important;
    opacity: 0.95;
    animation: slideIn 0.3s ease-out forwards;
}

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

/* Safari-specific positioning */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        #system-notifications {
            right: calc(2% + 20px) !important;
            left: auto !important;
            width: 320px !important;
            transform: translateZ(0);
            -webkit-transform: translateZ(0);
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
        }
        
        /* Force hardware acceleration */
        .notification-card {
            transform: translate3d(0,0,0);
            -webkit-transform: translate3d(0,0,0);
        }
    }
}

.main-content-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    overflow-x: hidden;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    #system-notifications {
        width: calc(100% - 40px);
        max-width: 100%;
        right: 20px;
    }
}

.menu {
    position: fixed;
    display: block;
    vertical-align: top;
    max-height: calc(100vh - 75px); /* Account for navbar height + additional padding */
    overflow-y: auto;
    top: 75px; /* Position below navbar with additional space */
    bottom: 0;
    padding: 0;
    width: inherit; /* Match parent column width */
    z-index: 5;
}

/* Add padding to body for fixed navbar */
body {
    padding-top: 70px; /* Increased to provide more space */
}

@media screen and (max-width: 767px) {
    .menu {
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        width: 100% !important;
    }
}

/* Enhanced Sidebar Menu */
.sidebar-menu {
    padding: 0;
    margin-right: 0;
    height: 100%;
}

/* Tablet-specific sidebar improvements */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .menu-section {
        margin: 0.75rem !important;
    }
}

.menu-section {
    border-radius: 8px;
    margin: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Item Card Styling */
.item-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.has-overflow-visible {
    overflow: visible !important;
}

.card-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.75rem !important;
    padding-top: 0 !important;
}

.no-margin-top {
    margin-top: 0 !important;
}

.no-margin-bottom {
    margin-bottom: 0 !important;
}

/* Compact item title */
.title.is-5.clothing-name {
    font-size: 1.1rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Collection title hover effect */
.collection-title {
    transition: color 0.2s ease;
    display: inline-block;
}

.collection-title:hover {
    color: #3273dc !important; /* Bulma's is-info color */
}

/* Collection card styling */
.collection-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.collection-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.collection-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.collection-card .columns {
    display: flex;
}

.collection-card .column {
    padding: 0;
}

/* Make images in collection cards fill their container */
.collection-card figure.image {
    border-radius: 0;
    margin: 0 !important;
}

/* Placeholder for collections without images */
.collection-placeholder {
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #3273dc;
    border-right: 1px solid #e0e0e0;
}

.collection-placeholder p {
    font-weight: 500;
    margin-top: 0.75rem;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Remove text decoration from links that shouldn't show underlines */
.no-text-decoration {
    text-decoration: none !important;
    color: inherit !important;
}

/* Quick Wear Button Styling */
.quick-wear-button, .quick-view-button {
    position: absolute;
    bottom: 25px; /* Moved down by 25px from previous 50px */
    left: 10px;
    z-index: 100;
    cursor: pointer;
}

.quick-wear-button button, .quick-view-button a.button {
    width: 45px;
    height: 45px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid white;
    opacity: 0.9;
}

.quick-wear-button button:hover, .quick-view-button a.button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 1;
}

/* Card image container relative positioning for absolute button positioning */
.card-image {
    position: relative;
    margin-bottom: -10px !important; /* Negative margin to pull content up */
}

.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.text-ellipsis-tag {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal !important;
    word-break: break-word;
    display: inline-block;
}

.has-shadow {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.has-radius {
    border-radius: 8px;
}

/* Category Section Styling */
.category-section {
    padding-bottom: 15px;
    padding-top: 10px;
    margin-top: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* Statistics Section Styling */
.statistics-section {
    border-radius: 8px;
}

/* Fix for Dropdown Menus */
.dropdown-menu {
    min-width: 12rem;
}

/* Main Container Fix */
.main-container {
    width: 100%;
    max-width: 100%;
    padding: 0 20px 0 0;
    margin: 0;
    margin-top: 25px; /* Balanced top margin for titles */
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

/* Sidebar column needs min-height for fixed positioning */
.sidebar-column {
    min-height: calc(100vh - 75px); /* Account for navbar height + additional padding */
}

/* Main content width fix and ensure space for sidebar */
.main-content {
    width: calc(100% - 16.66%); /* Subtract sidebar width (is-2 is 16.66%) */
    box-sizing: border-box;
    margin-left: 16.66%; /* Push content to account for fixed sidebar */
    padding-top: 20px; /* Add top padding to ensure content doesn't get covered by navbar */
}

/* Reset problematic Bulma defaults */
.columns {
    margin: 0 !important;
}

.column {
    padding: 0.5rem !important;
}

@media screen and (max-width: 768px) {
    .dropdown-menu {
        min-width: 10rem;
    }
}

/* Fix for Desktop Overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Form styles */
.input, .textarea, .select select {
    border-radius: 4px;
    border: 1px solid #dbdbdb;
    padding: 10px;
    width: 100%;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.input:focus, .textarea:focus, .select select:focus {
    border-color: #3273dc;
    box-shadow: 0 0 0 1px rgba(50, 115, 220, 0.25);
}

.input.is-danger, .textarea.is-danger, .select.is-danger select {
    border-color: #f14668;
}

.help.is-danger {
    color: #f14668;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.checkbox {
    margin-right: 0.5rem;
}

.field:not(:last-child) {
    margin-bottom: 0.75rem;
}

/* Compact form styles */
.field.mb-3 {
    margin-bottom: 0.5rem !important;
}

.is-small.mb-1 {
    margin-bottom: 0.25rem !important;
    font-size: 0.85rem;
}

/* Ensure spacing is consistent in compact forms */
.select.is-small select,
.input.is-small,
.textarea.is-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.help.is-size-7 {
    font-size: 0.75rem !important;
    margin-top: 0.15rem;
}

.label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.file-input {
    cursor: pointer;
}

.notification.is-light {
    background-color: #f5f5f5;
}

.notification.is-danger.is-light {
    background-color: #feecf0;
    color: #cc0f35;
}

/* Add styles for main content */
.main-content {
    padding-left: 1rem !important;
    padding-top: 1.5rem !important; /* Add extra padding to top of content */
    overflow-x: hidden;
}

/* Media Queries for Responsive Design */
/* Mobile/Small tablet - one card layout */
@media screen and (max-width: 767px) {
    .columns.is-desktop {
        display: block !important;
    }

    .column.is-2.sidebar-column {
        width: 100% !important;
        flex: none !important;
        display: block !important;
    }

    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
    }

    /* Keep consistent 20px padding on mobile */
}

/* Special tablet breakpoint to address overlay issue - two cards */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    /* Keep consistent 20px padding on tablet */
    .menu {
        position: relative !important;
        max-height: none !important;
        top: 0 !important;
        width: 100% !important;
    }

    .sidebar-menu {
        position: relative !important;
        max-height: none !important;
        margin-bottom: 20px;
        padding-bottom: 15px;
        width: 100% !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Force container width */
    .container, .main-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .sidebar-column {
        min-height: auto !important;
        width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Make columns stack on tablet */
    .columns.is-desktop {
        display: block !important;
    }
}

@media screen and (max-width: 767px) {
    .menu {
        position: relative;
        max-height: none;
        top: 0;
    }

    .sidebar-menu {
        position: relative;
        max-height: none;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Ensure column layout works on mobile */
    .column.is-4-desktop.is-6-tablet.is-12-mobile {
        display: block !important;
        width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Force display for item cards */
    .card.item-card {
        display: flex !important;
        margin-bottom: 1rem;
    }

    /* Make sure columns container doesn't break */
    .columns.is-multiline {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Ensure items don't disappear */
    .column {
        display: block !important;
    }
}

    .column {
        padding: 0.3rem !important;
        display: block !important;
    }

    .menu-section {
        margin-bottom: 10px;
        padding: 0.75rem !important;
    }

    .category-section {
        margin-bottom: 2rem;
    }

    .item-card {
        margin-bottom: 10px;
        max-width: 100%;
    }

    .title {
        font-size: 1.5rem !important;
        word-break: break-word;
    }

    h1.title {
        margin-top: 1.5rem !important;
        padding-top: 30px !important;
    }

    .statistics-section {
        padding: 1rem !important;
        margin-top: 2rem !important;
    }

    .card-content {
        padding: 0.75rem;
    }
}

/* Additional Mobile Optimizations */
@media screen and (max-width: 480px) {
    .column.is-12-mobile {
        padding: 0.25rem;
    }

    .card-content {
        padding: 0.5rem;
    }

    .item-actions {
        flex-wrap: wrap;
    }

    .item-actions form,
    .item-actions a {
        margin-bottom: 0.5rem;
    }
}

/* Grid for dates */
/* Article - https://bitsofco.de/github-contribution-graph-css-grid/ */

/* Grid-related CSS */

:root {
    --square-size: 15px;
    --square-gap: 5px;
    --week-width: calc(var(--square-size) + var(--square-gap));
}

.months { grid-area: months; }
.days { grid-area: days; }
.squares { grid-area: squares; }

.graph {
    display: inline-grid;
    grid-template-areas: "empty months"
                            "days squares";
    grid-template-columns: auto 1fr;
    grid-gap: 10px;
}

.months {
display: grid;
grid-template-columns: calc(var(--week-width) * 5) /* Jan */
                        calc(var(--week-width) * 4) /* Feb */
                        calc(var(--week-width) * 4) /* Mar */
                        calc(var(--week-width) * 5) /* Apr */
                        calc(var(--week-width) * 4) /* May */
                        calc(var(--week-width) * 4) /* Jun */
                        calc(var(--week-width) * 5) /* Jul */
                        calc(var(--week-width) * 4) /* Aug */
                        calc(var(--week-width) * 4) /* Sep */
                        calc(var(--week-width) * 5) /* Oct */
                        calc(var(--week-width) * 4) /* Nov */
                        calc(var(--week-width) * 5) /* Dec */;
}

.days {
    display: grid;
    grid-gap: 4px;
    grid-template-rows: repeat(7, var(--square-size));
}

.squares {
    display: grid;
    grid-gap: var(--square-gap);
    grid-template-rows: repeat(7, var(--square-size));
}

.squares {
    grid-auto-flow: column;
    grid-auto-columns: var(--square-size);
}


/* Other styling */

.graph {
    padding: 20px;
    border: 1px #e1e4e8 solid;
    margin: 20px;
}

.days li:nth-child(even) {
    visibility: hidden;
}

.squares li,
.squares li[data-level="0"] {
    background-color: #ebedf0;
}

.squares li[data-level="1"] {
    background-color: #c6e48b;
}

.squares li[data-level="2"] {
    background-color: #7bc96f;
}

.squares li[data-level="3"] {
    background-color: #196127;
}

.squares li[data-level="empty"] {
    background-color: #ffffff;
}

/* Tooltip container */
.tooltip {
    position: relative;
    display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.2;

    /* Position the tooltip text */
    position: absolute;
    z-index: 15;
    top: -5px;
    left: 105%;

    /* Add transition for smooth appearance */
    transition: opacity 0.2s ease;
    opacity: 0;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Add tooltip arrow */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent rgba(0, 0, 0, 0.8) transparent transparent;
}

/* Analytics Page Styles */
.analytics-section {
    margin-bottom: 2rem;
}

.wear-chart {
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    padding: 1.5rem 1rem 0.5rem 1rem;
    width: 100%;
}

.wear-chart div[style*="align-items: flex-end;"] {
    min-height: 200px !important;
    width: 100%;
}

/* Chart Bar Styling */
.wear-chart div[style*="height:"] {
    /* No hover effects or transitions */
}

/* Analytics Tabs Styling */
.tabs.is-boxed {
    margin-bottom: 1.5rem !important;
}

.tabs.is-boxed li {
    border-radius: 4px;
    margin-right: 5px;
}

.tabs.is-boxed li a {
    padding: 0.75rem 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Analytics Box Styling */
.analytics-section .box {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
    height: 100%;
}

.analytics-section .box:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Analytics table styles */
.analytics-section table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 4px;
    overflow: hidden;
}

.analytics-section table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.analytics-section table td,
.analytics-section table th {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.analytics-section table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Responsive fixes for analytics */
@media screen and (max-width: 768px) {
    .analytics-section .tabs li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .analytics-section .tabs {
        overflow-x: auto;
        display: flex;
        width: 100%;
    }

    .analytics-section .tabs ul {
        flex-wrap: nowrap;
    }

    .wear-chart div[style*="margin: 0 5px; position: relative;"] {
        margin: 0 2px !important;
    }

    /* Ensure chart title is more compact on mobile */
    .analytics-section .title.is-4 {
        font-size: 1.3rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Make chart more compact on mobile */
    .wear-chart {
        padding: 1rem 0.5rem 0.25rem 0.5rem !important;
    }

    /* Ensure month labels fit on small screens */
    .wear-chart div[style*="height: 40px; display: flex;"] div {
        font-size: 0.8rem !important;
    }

    /* Ensure table columns fit on mobile */
    .analytics-section table th,
    .analytics-section table td {
        padding: 0.5rem !important;
        font-size: 0.9rem !important;
    }
}