/* Default (Light Mode) */
.project-icon {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 6px auto;
    position: relative;
    object-fit: contain;
    background: linear-gradient(135deg, var(--app-dark-surface-light) 0%, var(--app-dark-surface) 30%, var(--app-dark-bg) 70%, var(--app-dark-surface-light) 100%);
    border-radius: 13px;
    padding: 6px;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    flex-shrink: 0;
    transition: none;
}

.icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--app-dark-surface-light) 0%, var(--app-dark-surface) 30%, var(--app-dark-bg) 70%, var(--app-dark-surface-light) 100%);
    border-radius: 13px;
    color: rgb(245, 245, 245);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2px auto 4px auto;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    flex-shrink: 0;
    transition: none;
}

.project-icon-square {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 6px auto;
    position: relative;
    object-fit: contain;
    background: linear-gradient(135deg, var(--app-dark-surface-light) 0%, var(--app-dark-surface) 30%, var(--app-dark-bg) 70%, var(--app-dark-surface-light) 100%);
    border-radius: 13px;
    padding: 5px;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    flex-shrink: 0;
    transition: none;
}

.project-icon img,
.project-icon-square img {
    border-radius: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-top: 0px;
    margin-bottom: 5px;
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .project-icon,
    .project-icon-square,
    .icon-fallback {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }

    .project-icon {
        padding: 6px;
    }

    .project-icon-square {
        padding: 4px;
    }

    .icon-fallback {
        font-size: 1rem;
        margin-bottom: 0;
    }
}

/* Non-mobile hover rules (769px and up) */
@media (min-width: 769px) {
    body:not(.details-toggle-active) .tile.tile-hovered:not(.details-expanded) .project-icon,
    body:not(.details-toggle-active) .tile.tile-hovered:not(.details-expanded) .project-icon-square,
    body:not(.details-toggle-active) .tile.tile-hovered:not(.details-expanded) .icon-fallback {
        display: none !important;
    }
}