/* Links Page Styling */

.links-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.links-container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;        /* vertical centre of the free space */
    justify-content: center;    /* horizontal centre */
    padding: 1rem 1.5rem;
    min-height: 0;
}

/* four compact columns, centred as a block */
.links-btn-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    width: min(100%, 980px);
    margin: 0 auto;
}

.link-list {
    position: relative;
    background: linear-gradient(135deg, #1b7dbe, #024175);
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    height: 100%;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
}

.link-list.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.link-list:has(h3 strong) {
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.link-list:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.link-list:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.link-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #024175 , #1b7dbe);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.link-list:hover::before {
    opacity: 1;
}

.link-list a {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.8rem;
    min-height: 3.6rem;
    color: white;
    text-decoration: none;
    position: relative;
    z-index: 2;
    height: 100%;
    width: 100%;
}

.link-list i {
    font-size: 1.1rem;
    margin-right: 0.6rem;
    flex: none;
    transition: transform 0.3s ease;
}

.link-list:hover i {
    transform: scale(1.2);
}

.link-list h3 {
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.link-list:hover h3 {
    transform: translateX(5px);
}

/* Add a subtle pulse animation for new links */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

.link-list.new {
    animation: pulse 2s infinite;
}

/* Ripple effect for click feedback */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    z-index: 1;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Additional hover state class added by JS */
.link-list.hover-active i {
    transform: scale(1.2);
    color: #ffffff;
}

.link-list.hover-active h3 {
    transform: translateX(5px);
    color: #ffffff;
}

/* Page frame: the Links page fills the scroll area so the tiles can centre vertically; the ad strip (when filled) sits at the bottom */
#links-page.active {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

#links-page.active > .ad-links { flex: none; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .links-btn-container { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 560px); }
}

@media (max-width: 480px) {
    .links-container { padding: 0.75rem; }
    .links-btn-container { grid-template-columns: 1fr; }
    .link-list a { padding: 0.6rem 0.75rem; }
}
