/* Layout switcher styles */
.layout-switcher {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the buttons */
    margin-bottom: 1.5rem; /* More space below the buttons */
    margin-top: 0.5rem; /* Add some space above the buttons */
}


.layout-buttons {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.layout-button {
    background-color: var(--color-card-bg);
    border: none;
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 48px;
}

.layout-button:first-child {
    border-right: 1px solid var(--color-border);
}

.layout-button:hover {
    background-color: var(--color-light);
}

.layout-button.active {
    background-color: var(--color-primary);
    color: white;
}

.layout-button i {
    font-size: 1.3rem;
}

/* Hide desktop switcher on mobile and vice versa */
@media (max-width: 767.98px) {
    .desktop-layout-switcher {
        display: none;
    }
}

@media (min-width: 768px) {
    .mobile-layout-switcher {
        display: none;
    }
}

/* Desktop layout styles */
@media (min-width: 768px) {
    /* Only apply compact layout on desktop if desktop compact is active */
    .compact-layout .category-section {
        display: none;
    }
    
    .compact-layout .compact-tiles {
        display: block;
    }
}

/* Mobile layout styles */
@media (max-width: 767.98px) {
    /* Only apply compact layout on mobile if mobile compact is active */
    .compact-layout-mobile .category-section {
        display: none;
    }
    
    .compact-layout-mobile .compact-tiles {
        display: block;
    }
}

/* Mobile compact layout styles - only apply on small screens */
@media (max-width: 767.98px) {
    .compact-layout-mobile .tile-card {
        height: 120px; /* Even more compact height */
    }
    
    .compact-layout-mobile .tile-icon-container {
        height: 70px; /* Smaller icon container */
        padding: 0.5rem; /* Reduced padding */
    }
    
    .compact-layout-mobile .tile-icon {
        max-height: 50px; /* Smaller icon */
        max-width: 50px;
    }
    
    .compact-layout-mobile .tile-content {
        padding: 0.4rem; /* Less padding in content area */
    }
    
    .compact-layout-mobile .tile-title {
        font-size: 0.85rem; /* Smaller font */
        margin-bottom: 0.2rem; /* Less bottom margin */
    }
    
    /* Smaller badges for inactive tiles */
    .compact-layout-mobile .restriction-badges {
        margin-top: 0.1rem;
        gap: 0.15rem;
    }
    
    .compact-layout-mobile .restriction-badges .badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
}

/* By default hide compact tiles */
.compact-tiles {
    display: none;
}

/* Adjust grid for compact mobile view */
@media (max-width: 767.98px) {
    /* Force 3 columns on mobile for compact layout */
    .compact-layout-mobile .row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.3rem; /* Smaller gap between tiles */
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Override Bootstrap column styles to ensure equal width */
    .compact-layout-mobile .col {
        width: 100%;
        max-width: 100%;
        padding: 0.15rem; /* Smaller padding */
        flex: none;
    }
    
    /* Ensure tile cards are the same height */
    .compact-layout-mobile .tile-wrapper {
        height: 100%;
    }
    
    .compact-layout-mobile .tile-card {
        height: 100%;
    }
}
