
#logo {
    width: 200px;
}

@media (max-width: 768px) {
    #logo {
        width: 150px;
    }
}

@media (max-width: 576px) {
    #logo {
        width: 100px;
    }
}

form label {
    font-weight: bold;
}

form .helptext, form .helptext * {
    color: var(--pico-muted-color);
}

.errorlist {
    color: var(--pico-form-element-invalid-border-color)
}

#graphContainer {
    margin: 40px;
}

header h3 {
    margin-bottom: 0;
}

.defaulthidden {
    display: none;
}

.graphcontainerblock {
    min-height: 400px;
}

.graphcontainerblock svg {
    overflow: visible;
}

dialog button[type="submit"] {
    width: unset;
}

.no-margin-bottom {
    margin-bottom: 0;
}

/* Language Switcher Styles */
header.sticky-header .flag-container {
    position: absolute !important;
    z-index: 1000 !important;
}

header.sticky-header .flag-container form {
    display: flex !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

/* Position and layout based on screen size */
@media (min-width: 768px) {
    /* Desktop layout */
    header.sticky-header .flag-container {
        right: 1rem !important;
        top: 1rem !important;
    }
}

@media (max-width: 767px) {
    /* Mobile layout */
    header.sticky-header nav {
        position: relative !important;
        padding-top: 2.5rem !important;
        display: flex !important;
        flex-direction: column !important;
    }

    header.sticky-header nav ul {
        width: 100% !important;  /* Full width for both uls */
        margin: 0 !important;
        padding: 0 !important;
    }

    header.sticky-header nav ul:first-child {  /* Logo container */
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }

    header.sticky-header nav ul:last-child {  /* Login/Register links */
        display: flex !important;
        justify-content: flex-end !important;  /* Align to right */
        gap: 1rem !important;  /* Space between links */
        margin-top: 1rem !important;
    }

    header.sticky-header nav ul:last-child li {
        width: auto !important;
        min-width: max-content !important;
    }

    header.sticky-header nav ul:last-child li a {
        display: block !important;
        width: 100% !important;
        padding: 0.5rem 1rem !important;
        text-align: center !important;
        white-space: nowrap !important;
    }
    
    header.sticky-header .flag-container {
        right: 1rem !important;
        top: 0.5rem !important;
    }
}


header.sticky-header .flag-container button {
    background: none !important;
    border: none !important;
    padding: 4px !important;
    cursor: pointer !important;
    display: flex !important;
    position: relative !important;  /* Added */
    z-index: 2 !important;         /* Added */
    min-width: unset !important;
    width: auto !important;
}

/* Add these new hover styles */
header.sticky-header .flag-container button::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.1) !important;
    opacity: 0 !important;
    transition: opacity 0.3s !important;
    border-radius: 4px !important;
}

header.sticky-header .flag-container button:hover::after {
    opacity: 1 !important;
}

header.sticky-header .flag-container img {
    width: 24px !important;
    height: 20px !important;
    pointer-events: auto;
    position: relative !important;
    z-index: 1 !important;
    object-fit: cover !important;
}

.assets-and-add-container {
    display: grid;
    gap: 2rem;
}

.assets-section {
    grid-row: 1;
}

.add-asset-section {
    grid-row: 2;
    max-width: 400px;  /* Limit width when stacked */
    justify-self: center;  /* Center the narrower section */
    width: 100%;  /* Take full width up to max-width */
    height: fit-content;
}

/* Desktop layout */
@media (min-width: 768px) {
    .assets-and-add-container {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }

    .assets-section {
        grid-row: 1;
        grid-column: 1;
    }

    .add-asset-section {
        grid-row: 1;
        grid-column: 2;
        max-width: none;  /* Remove width limitation on desktop */
        justify-self: stretch;  /* Stretch to fill column */
    }
}


.assets-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    width: 100%;
}

.asset-card {
    width: 100%;
    min-width: 0;  /* Prevents overflow */
}

/* Ensure the section doesn't overflow */
.assets-section {
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;  /* Prevent horizontal scroll */
}

/* Make sure asset cards wrap text if needed */
.asset-card h3 {
    word-break: break-word;
    overflow-wrap: break-word;
}


/* Add to your style.css */
dialog {
    width: 100% !important;
    max-width: min(600px, 95vw) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 90vh !important;
    overflow: hidden !important;
}

dialog article {
    margin: 0 !important;
    padding: 1rem !important;
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;  /* Firefox */
    -ms-overflow-style: none !important;  /* IE and Edge */
}

@media (max-width: 576px) {
    dialog {
        max-width: 95vw !important;
        max-height: 85vh !important;  /* Slightly smaller to ensure it fits */
    }

    dialog article {
        padding: 0.75rem !important;
    }

    dialog article header {
        margin-bottom: 0.5rem !important;
    }

    dialog article header h1 {
        font-size: 1.25rem !important;
        margin: 0 !important;
    }

    dialog form div {
        margin-bottom: 0.75rem !important;
    }

    dialog article footer {
        display: flex !important;
        gap: 0.5rem !important;
        flex-direction: column !important;  /* Stack buttons vertically */
        margin-top: 1rem !important;
    }

    dialog article footer button {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Make form inputs more touch-friendly */
    dialog input, 
    dialog select, 
    dialog textarea {
        font-size: 16px !important;  /* Prevent iOS zoom */
        padding: 0.5rem !important;
    }
}