:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --card-border: #e4e6eb;
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --accent: #1877f2;
    /* Classic Facebook-like blue */
    --accent-hover: #166fe5;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.page-header {
    text-align: center;
    padding: 40px 0 20px;
    background-color: #fff;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Search */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.2s;
}

#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.2);
    border-color: var(--accent);
}

/* Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.link-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
    position: relative;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Image/Icon Styling */
.icon-box {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    /* Optional rounded corners for favicons */
}

/* Fallback if we keep icons for some reason, though plan is images */
.icon-box i {
    font-size: 2.5rem;
    color: var(--accent);
}

.link-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.link-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.link-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: #e4e6eb;
    border-radius: 12px;
    color: var(--text-secondary);
}

/* Back to Home Button */
.back-home-btn {
    display: inline-block;
    margin: 20px 20px 0 20px;
    /* Top margin for spacing if at top of body */
    padding: 10px 20px;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.back-home-btn:hover {
    background-color: var(--accent-hover);
    text-decoration: none;
}

/* =========================
   FOOTER (Ported from Root)
========================= */

/* --- General Footer Styling --- */
footer {
    background: linear-gradient(180deg, #000080 50%, #006eff 100%) !important;
    color: white;
    padding: 40px 20px;
    font-family: Arial, sans-serif;
    margin-top: auto;
    text-align: left;
    /* Reset text-align from previous center */
}

/* --- Main Center Heading Styling (H2) --- */
.footer-main-heading {
    max-width: 1200px;
    margin: 0 auto 30px;
    text-align: center;
    border-bottom: 2px solid #ffd000;
    padding-bottom: 10px;
}

.footer-main-heading h2 {
    font-size: 1.8em;
    font-family: 'Times New Roman', Times, serif;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Container for Sections --- */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

/* --- Individual Section Styling --- */
.footer-section {
    flex-basis: 200px;
    flex-grow: 1;
}

/* --- Heading Styling (NOW USING H1) --- */
.footer-section h1 {
    font-size: 1.1em;
    color: #1abc9c;
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- List Styling --- */
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #ffd000;
}

/* --- Social Icons Styling --- */
.social-icons {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    /* Circle shape */
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    color: white;
    /* Default text color */
    background-color: #bdc3c7;
    /* Default background */
    transition: transform 0.2s, background-color 0.3s;
}

.social-icons a:hover {
    transform: translateY(-3px);
}

/* Applying Brand Colors for recognition */
.social-icons .wikipedia {
    background-color: #919191;
}

.social-icons .youtube {
    background-color: #ff0000;
}

.social-icons .facebook {
    background-color: #006eff;
}

.social-icons .x {
    background-color: #000000;
}

/* --- Copyright/Bottom Section --- */
.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    border-top: 1px solid #4a637a;
    padding-top: 20px;
    text-align: center;
    font-size: 1.2em;
    color: #bdc3c7;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }
}