@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap);
/* Import Inter font */

/* Theme Variables */
:root {
    /* Light Theme Colors */
    --primary: #0085ff;
    --primary-rgb: 0, 133, 255;
    --primary-hover: #0066cc;
    --primary-light: #e6f3ff;
    --surface: #ffffff;
    --background: #eef2f6;
    --background-light: #ffffff;
    --text: #000000;
    --text-secondary: #536471;
    --border: #e4e6eb;
    --shadow: rgba(0, 0, 0, 0.08);
    --disabled: #e4e6eb;
    --danger: #f4212e;
    --error: #dc3545;
    --like: #f91880;
    --repost: #00ba7c;
    --link: #0085ff;

    /* Font Size Variables */
    --base-font-size: 15px;
    --font-scale: 1;
    --font-size-small: calc(0.867rem * var(--font-scale));  /* 13px equivalent */
    --font-size-default: calc(1rem * var(--font-scale));    /* 15px equivalent */
    --font-size-large: calc(1.133rem * var(--font-scale));  /* 17px equivalent */

    /* Gradients */
    --surface-gradient: linear-gradient(180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%);

    /* Shadows */
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Layout */
    --branding-width: 42%;
    --content-width: 58%;
    --min-width: 320px;

    /* Other */
    --border-radius: 8px;
    --button-transition: 200ms ease-in-out;
}

/* Dark Theme */
[data-theme="dark"] {
    --surface: #15202b;
    --background: #1e2732;
    --background-light: #1a2634;
    --text: #f7f9f9;
    --text-secondary: #8b98a5;
    --border: #38444d;
    --shadow: rgba(255, 255, 255, 0.08);
    --primary-light: rgba(0, 133, 255, 0.1);

    /* Dark theme specific */
    --surface-gradient: linear-gradient(180deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 100%);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--base-font-size);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--background);
    font-size: var(--font-size-default);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* System Theme Detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Default to dark theme when system prefers dark */
        --surface: #15202b;
        --background: #1e2732;
        --background-light: #1a2634;
        --text: #f7f9f9;
        --text-secondary: #8b98a5;
        --border: #38444d;
        --shadow: rgba(255, 255, 255, 0.08);
        --primary-light: rgba(0, 133, 255, 0.1);
        --surface-gradient: linear-gradient(180deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.01) 100%);
        --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
}

/* Button Base Styles */
.btn-auth,
.btn-refresh,
.btn-mute-keywords,
.nav-mute-button {
    padding: 8px 16px;
    border-radius: 9999px; /* Bluesky uses fully rounded buttons */
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

/* Auth Button */
.btn-auth {
    background: var(--primary);
    color: #ffffff;
    padding: 12px 24px;
    min-width: 120px;
}

.btn-auth-small {
    padding: 8px 16px;
    margin: 0;
}

.btn-auth:hover {
    background: var(--primary-hover);
}

/* Refresh Button */
.btn-refresh {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-refresh:hover {
    background: var(--background);
    border-color: var(--border);
}

.btn-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

/* Spinning animation for refresh button */
.btn-refresh.spinning {
    position: relative;
}

.btn-refresh.spinning::before {
    content: '↻';
    display: inline-block;
    margin-right: 4px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mute Buttons */
.btn-mute-keywords,
.nav-mute-button {
    background: var(--primary);
    color: #ffffff;
    display: none;
}

.btn-mute-keywords.visible,
.nav-mute-button.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-mute-keywords:hover,
.nav-mute-button:hover {
    background: var(--primary-hover);
}

/* Secondary Button Style */
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
}

/* Outline Button Style */
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* Bluesky Handle Input */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper::before {
    content: '@';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 15px;
    z-index: 1;
    pointer-events: none;
}

.bsky-handle-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 36px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    background: var(--background);
    color: var(--text);
    transition: var(--transition);
}

.bsky-handle-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.bsky-handle-input:focus {
    outline: none;
    background: var(--background);
    box-shadow: 0 0 0 2px var(--primary);
}

.bsky-handle-input.error {
    background: rgba(220, 53, 69, 0.1);
    box-shadow: 0 0 0 2px var(--danger);
    animation: shake 0.5s;
}

/* Animation for error state */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Auth Container */
.bsky-connect {
    background: var(--surface);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: visible;
}

.bsky-connect::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--surface-gradient);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    border-radius: inherit;
    pointer-events: none; /* Add this to fix click blocking */
}

.bsky-connect:hover::before {
    opacity: 1;
}

/* Sign In Header */
.sign-in-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Auth Container Layout */
.bsky-auth-container {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    gap: 24px;
}

/* Auth Section */
.auth-section {
    width: 100%;
}

/* Explanatory Text */
.bsky-auth-message {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Input & Button Overrides */
.bsky-handle-input,
.btn-auth {
    min-height: 48px;
    height: auto;
    padding: 14px 16px;
    line-height: 1.3;
    border-radius: 12px;
    width: 100%;
}

.bsky-handle-input {
    background: var(--background);
    padding-left: 36px;
    border: 1px solid rgba(0, 122, 255, 0.15);
    transition: border-color 0.2s ease-in-out;
}

/* Error States */
.bsky-auth-message.error {
    color: var(--error);
    background: rgba(var(--error-rgb), 0.1);
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
}

@media (max-width: 768px) {
    .bsky-connect {
        padding: 20px;
        border-radius: 16px;
    }

    .bsky-auth-container {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .bsky-connect {
        padding: 16px;
        border-radius: 12px;
    }

    .bsky-auth-container {
        gap: 16px;
        margin-top: 20px;
    }

    .bsky-auth-message {
        font-size: 14px;
    }
}

/* Landing Page Feature Cards */
.landing-feature-card {
    background: var(--surface);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.landing-feature-card .feature-icon {
    font-size: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--background);
    border-radius: 14px;
}

.landing-feature-card .feature-text {
    flex: 1;
    min-width: 0;
}

.landing-feature-card .feature-text h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.landing-feature-card .feature-text p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Media Queries */
@media (max-width: 768px) {
    .landing-feature-card {
        padding: 20px;
    }

    .landing-feature-card .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .landing-feature-card .feature-text h3 {
        font-size: 18px;
    }

    .landing-feature-card .feature-text p {
        font-size: 14px;
    }
}

/* Media Queries */
@media (max-width: 768px) {
    /* Button Responsiveness */
    .btn-auth {
        width: 100%;
    }

    .btn-auth-small {
        width: 100%;
    }

    /* Toggle Controls Responsiveness */
    .mode-toggle,
    .toggle-all-controls {
        width: 100%;
    }

    /* Auth Container Responsiveness */
    .bsky-connect {
        flex-direction: column;
        width: 100%;
    }

    .bsky-auth-container {
        max-width: none;
        width: 100%;
    }

    /* Category Section Responsiveness */
    .category-section .keywords-container {
        columns: 1;
    }
}

/* Split Layout for Landing Page */
.split-layout {
    display: flex;
    min-height: 100vh;
    background: var(--surface);
}

/* Content Section (Right) */
.content-section {
    flex: 0 0 var(--content-width);
    background: var(--surface);
    min-height: 100vh;
    overflow-y: auto;
}

.content-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 32px;
        /* Reduced top padding from 24px to 16px */
    width: 100%;
}

/* Branding Section (Left) */
.branding-section {
    flex: 0 0 var(--branding-width);
    background: var(--background);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.branding-content {
    text-align: center;
    max-width: 420px;
}

.logo {
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.logo img {
    width: 245px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.branding-content h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 20px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0 auto;
    max-width: 360px;
}

/* Built by Section */
.built-by-section {
    text-align: center;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.built-by-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.built-by-content p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.built-by-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.built-by-content a:hover {
    color: var(--primary-hover);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.landing-feature-card {
    background: var(--background);
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-icon {
    font-size: 24px;
    line-height: 1;
}

.feature-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-text p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Detailed Features Section */
.detailed-features {
    padding-top: 0;
}

.section-intro {
    text-align: center;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-intro h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-intro p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.feature-blocks {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.feature-block {
    display: flex;
    flex-direction: column;
    gap: 32px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.feature-block:nth-child(1) { animation-delay: 0.1s; }
.feature-block:nth-child(2) { animation-delay: 0.2s; }
.feature-block:nth-child(3) { animation-delay: 0.3s; }
.feature-block:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    background: var(--background);
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease;
    position: relative;
}

/* Add loading state */
.feature-image.loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--background);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

/* Error state styling */
.feature-image.image-load-error {
    background-color: var(--background);
    border: 2px dashed var(--border-color);
}

.feature-image.image-load-error::after {
    content: '⚠️ Image failed to load';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text);
    font-size: 14px;
    text-align: center;
    padding: 8px 16px;
    background-color: var(--background);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feature-description {
    color: var(--text);
}

.feature-description h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.feature-description p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.feature-description ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.feature-description li {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}

.feature-description li:before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--primary);
}

/* Auth Section */
.bsky-connect {
    padding: 32px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 96px;
    position: relative;
}

.bsky-connect:after {
    content: "";
    position: absolute;
    bottom: -48px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    opacity: 0.3;
}

.sign-in-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

.bsky-auth-message {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.5;
}

/* Theme Toggle Switch */
.theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    border-radius: 50px;
    border: none;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    outline: none;
    background-color: var(--background);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    margin-left: 8px;
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.theme-toggle::before {
    content: "";
    position: absolute;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.theme-toggle.dark::before {
    transform: translateX(28px);
}

.theme-toggle .toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: var(--text);
    font-size: 14px;
    line-height: 1;
    width: 20px;
    height: 20px;
    position: relative;
}

.theme-toggle .sun-icon {
    margin-right: auto;
    transform: translateX(-2px);
}

.theme-toggle .moon-icon {
    margin-left: auto;
    transform: translateX(1px);
}

/* Hide emoji in dark mode */
.theme-toggle.dark .sun-icon {
    opacity: 0.5;
}

/* Hide emoji in light mode */
.theme-toggle:not(.dark) .moon-icon {
    opacity: 0.5;
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .content-wrapper {
        padding: 32px 24px;
    }
}

@media (max-width: 1024px) {
    .split-layout {
        flex-direction: column;
    }

    .branding-section {
        position: relative;
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 50vh;
        padding: 48px 24px;
    }

    .content-section {
        flex: 0 0 auto;
        width: 100%;
    }

    .content-wrapper {
        padding: 32px 24px;
    }

    .branding-content {
        max-width: 100%;
    }

    .tagline {
        max-width: 480px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .feature-blocks {
        gap: 64px;
    }

    .section-intro {
        margin-bottom: 48px;
    }

    .bsky-connect {
        margin-bottom: 80px;
    }

    .bsky-connect:after {
        bottom: -40px;
        width: 48px;
    }

    .built-by-section {
        margin-top: 48px;
    }
}

@media (max-width: 768px) {
    .logo img {
        width: 200px;
    }

    .section-intro h2 {
        font-size: 32px;
    }

    .section-intro p {
        font-size: 16px;
    }

    .feature-description h3 {
        font-size: 20px;
    }

    .feature-description p,
    .feature-description li {
        font-size: 15px;
    }

    .feature-blocks {
        gap: 48px;
    }

    .feature-block {
        gap: 24px;
    }

    .built-by-section {
        margin-top: 40px;
        padding-top: 24px;
    }

    .built-by-content {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .branding-section {
        padding: 32px 20px;
        min-height: auto;
    }

    .content-wrapper {
        padding: 24px 20px;
    }

    .logo img {
        width: 160px;
    }

    .branding-content h1 {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .tagline {
        font-size: 18px;
    }

    .feature-blocks {
        gap: 40px;
    }

    .section-intro {
        margin-bottom: 40px;
    }

    .section-intro h2 {
        font-size: 28px;
    }

    .bsky-connect {
        margin-bottom: 64px;
        padding: 24px;
    }

    .bsky-connect:after {
        bottom: -32px;
        width: 40px;
    }

    .built-by-section {
        margin-top: 32px;
        padding-top: 20px;
    }

    .built-by-content p {
        font-size: 14px;
    }
}

/* Landing Page Styles - Split into modular files */

/* Critical landing/authentication surface. */
