:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 3rem 1rem;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    transition: transform 0.2s;
}

.logo-title:hover {
    transform: scale(1.02);
}

.logo-title img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Search Bar */
.search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.95);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Controls (Dark Mode) */
.header-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

/* Main Content */
.main-content {
    width: 90%;
    max-width: 1200px;
    margin: 3rem auto;
    padding-bottom: 4rem;
}

.link-section {
    margin-bottom: 4rem;
    animation: fadeIn 0.5s ease-out;
}

.link-section-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-section-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.link-section-title a:hover {
    color: var(--primary-color);
}

.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.link {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.link a {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    gap: 12px;
}

.link img.logo-sm {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

/* Footer */
.site-footer {
    background: var(--card-bg);
    padding: 3rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Scroll Buttons */
.scroll-buttons {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.scroll-buttons.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-button {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.scroll-button:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        padding: 2rem 1rem;
    }
    
    .logo-title {
        font-size: 1.8rem;
    }
    
    .link-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .link a {
        padding: 1rem;
        font-size: 0.95rem;
    }
}
