:root {
    --apple-gray: #f5f5f7;
    --apple-black: #1d1d1f;
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-light-gray: #86868b;
}

/* Dark theme variables */
.dark-theme {
    --apple-gray: #1d1d1f;
    --apple-black: #f5f5f7;
    --apple-blue: #2997ff;
    --apple-blue-hover: #0077ed;
    --apple-light-gray: #86868b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #fff;
    color: var(--apple-black);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-theme body {
    background-color: #000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dark-theme header {
    background-color: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
}

h1 {
    font-size: 20px;
    font-weight: 600;
}

h1 a {
    text-decoration: none;
    color: var(--apple-black);
    transition: opacity 0.2s;
}

h1 a:hover {
    opacity: 0.8;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li a {
    text-decoration: none;
    color: var(--apple-black);
    font-size: 14px;
    padding: 0 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

nav ul li a:hover {
    opacity: 1;
}

nav ul li a.active {
    color: var(--apple-blue);
    opacity: 1;
}

.hero {
    padding: 120px 0 60px;
    text-align: center;
}

.hero h2 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.dark-theme .hero h2 {
    color: #000000;
}

.hero p {
    font-size: 24px;
    color: var(--apple-light-gray);
    max-width: 600px;
    margin: 0 auto;
}

.dark-theme .hero p {
    color: rgba(0, 0, 0, 0.8);
}

.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 30px 0 80px;
}

.link-item {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.dark-theme .link-item {
    background: #1d1d1f;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.link-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.link-image {
    height: 48px; /* Match bias-indicator height */
    background-color: var(--apple-gray);
    position: relative;
    overflow: hidden;
}

/* Bias indicator */
.bias-indicator {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.bias-indicator.liberal {
    background-color: #0078e7; /* Blue for Liberal */
}

.bias-indicator.conservative {
    background-color: #cf2e2e; /* Red for Conservative */
}

.bias-indicator.neutral {
    background-color: #6b6b6b; /* Gray for Neutral */
}

.link-content {
    padding: 24px;
}

.link-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.link-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 14px;
}

.link-url {
    color: var(--apple-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
}

.link-url:hover {
    background-color: rgba(0, 113, 227, 0.1);
    transform: translateY(-2px);
}

.dark-theme .link-url:hover {
    background-color: rgba(41, 151, 255, 0.1);
}

footer {
    background-color: var(--apple-gray);
    padding: 30px 0;
    font-size: 12px;
    color: var(--apple-light-gray);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-link {
    color: var(--apple-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-links {
        gap: 12px;
        flex-direction: column;
        align-items: center;
    }
}

/* Add button removed */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 18px;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s, background-color 0.3s;
}

.dark-theme .modal-content {
    background: #1d1d1f;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--apple-light-gray);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.2s, background-color 0.3s, color 0.3s;
}

.dark-theme input, 
.dark-theme select, 
.dark-theme textarea {
    background-color: #000;
    border-color: #333;
    color: var(--apple-black);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--apple-blue);
}

button.submit-button {
    background-color: var(--apple-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

button.submit-button:hover {
    background-color: var(--apple-blue-hover);
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 70px;
    right: 30px;
    width: 50px;
    height: 26px;
    background-color: var(--apple-gray);
    border-radius: 13px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 3px;
    transition: background-color 0.3s;
}

.theme-toggle-circle {
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #1d1d1f;
}

.dark-theme .theme-toggle {
    background-color: #4a4a4a;
}

.dark-theme .theme-toggle-circle {
    transform: translateX(24px);
    background-color: #1d1d1f;
    color: white;
}

/* System auto dark mode - only applies if no theme class is applied */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme):not(.dark-theme) {
        background-color: #000;
        color: #f5f5f7;
    }
    
    body:not(.light-theme):not(.dark-theme) header {
        background-color: rgba(0, 0, 0, 0.8);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    body:not(.light-theme):not(.dark-theme) .link-item {
        background: #1d1d1f;
    }
    
    body:not(.light-theme):not(.dark-theme) .modal-content {
        background: #1d1d1f;
    }
    
    body:not(.light-theme):not(.dark-theme) input,
    body:not(.light-theme):not(.dark-theme) select,
    body:not(.light-theme):not(.dark-theme) textarea {
        background-color: #000;
        border-color: #333;
        color: #f5f5f7;
    }
}

/* Dynamic hover effect */
.link-item {
    transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1), 
                box-shadow 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.link-item:hover {
    transform: scale(1.02) translateY(-8px);
}

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 40px 0;
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--apple-light-gray);
}

.empty-state p {
    color: var(--apple-light-gray);
    font-size: 16px;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    nav ul li a {
        padding: 0 10px;
    }
    
    .links-container {
        grid-template-columns: 1fr;
    }
}

/* Addition for smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Pagination styles */
.pagination {
    width: 100%;
    text-align: center;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1; /* Make it span across all columns */
}

.pagination a {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--apple-blue);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--apple-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .pagination {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--apple-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.3s;
    z-index: 100;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background-color: var(--apple-blue-hover);
}

.dark-theme .scroll-top-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Privacy notice styles */
.privacy-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 20px;
    font-size: 14px;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
}

.privacy-notice.active {
    transform: translateY(0);
}

.privacy-notice-text {
    flex: 1;
    padding-right: 20px;
}

.privacy-notice-text a {
    color: var(--apple-blue);
    text-decoration: none;
}

.privacy-notice-text a:hover {
    text-decoration: underline;
}

.privacy-notice-buttons {
    display: flex;
    gap: 10px;
}

.privacy-button {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.accept-button {
    background-color: var(--apple-blue);
    color: white;
}

.accept-button:hover {
    background-color: var(--apple-blue-hover);
}

.settings-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.settings-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .privacy-notice {
    background-color: rgba(40, 40, 40, 0.95);
}