/* ===================================================================
   DATABASE/COMPONENTS/GRID.CSS
   Mod Grid Layout
   =================================================================== */

/* Mod grid container */
.mod-grid,
#mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px);
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    overflow-y: visible;
    scrollbar-width: none;
}

/* Grid centered content */
#mod-grid .col-12.text-center,
#mod-grid > div:not(.mod-card),
#mod-grid > .text-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 0;
    text-align: center;
    grid-column: 1 / -1;
}

/* Grid text elements */
#mod-grid .text-danger,
#mod-grid .text-light {
    display: block;
    width: 100%;
    text-align: center;
}

/* Standard card centering */
.mod-grid > .mod-card:only-child,
#mod-grid > .mod-card:only-child {
    margin: 0 auto;
    max-width: 320px;
}

/* Large card centering */
.mod-grid > .config-card:only-child,
#mod-grid > .config-card:only-child,
.mod-grid > .large-card:only-child,
#mod-grid > .large-card:only-child {
    margin: 0 auto;
    max-width: 660px;
}

/* Empty state message */
#mod-grid:empty + .no-mods-message,
#mod-grid + .no-mods-message {
    text-align: center;
    display: block;
    margin-top: 5px;
    color: #fff;
}

.no-mods-message {
    width: 80%;
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    padding: 20px;
}

/* Empty state message */
.empty-state-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem;
    box-sizing: border-box;
    grid-column: 1 / -1;
}

/* Content width limitation */
.empty-state-message > * {
    max-width: 800px;
    width: 100%;
}

/* Welcome message - reduce spacing */
.welcome-message {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Card styling */
.mod-card {
    background-color: rgba(33, 37, 41, 0.8);
    border-radius: 8px;
    padding: 5px;
    height: 360px;
    min-height: 360px;
    width: 95%;
    max-width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    margin: 0;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Lock all card children to prevent any shifts */
.mod-card * {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Responsive */
@media (max-width: 992px) {
    .mod-grid,
    #mod-grid {
        gap: 16px;
    }
    
    .empty-state-message {
        min-height: 250px;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .mod-grid,
    #mod-grid {
        gap: 12px;
    }
    
    .empty-state-message {
        min-height: 200px;
        padding: 1rem;
    }
}
