/* Modern CSS Reset & Variable Definitions */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    /* Color Palette - HSL Tailored (Dark Mode by default) */
    --hue: 250;
    --background: hsl(var(--hue), 20%, 8%);
    --surface: hsl(var(--hue), 15%, 12%);
    --surface-hover: hsl(var(--hue), 15%, 16%);
    --border: hsl(var(--hue), 12%, 18%);
    --text-primary: hsl(var(--hue), 10%, 90%);
    --text-secondary: hsl(var(--hue), 8%, 65%);
    --text-tertiary: hsl(var(--hue), 8%, 45%);
    
    --primary: hsl(265, 85%, 65%);
    --primary-hover: hsl(265, 90%, 70%);
    --primary-gradient: linear-gradient(135deg, hsl(265, 85%, 65%), hsl(290, 80%, 60%));
    --accent: hsl(180, 80%, 45%);
    --danger: hsl(0, 80%, 60%);
    --success: hsl(140, 70%, 50%);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
    --font-serif: 'Playfair Display', Georgia, serif;
    
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --background: hsl(var(--hue), 25%, 97%);
    --surface: hsl(var(--hue), 20%, 100%);
    --surface-hover: hsl(var(--hue), 20%, 95%);
    --border: hsl(var(--hue), 15%, 88%);
    --text-primary: hsl(var(--hue), 25%, 15%);
    --text-secondary: hsl(var(--hue), 15%, 40%);
    --text-tertiary: hsl(var(--hue), 12%, 60%);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Sepia Theme Variables (Optimized for Reading) */
[data-theme="sepia"] {
    --background: hsl(35, 30%, 88%);
    --surface: hsl(35, 35%, 92%);
    --surface-hover: hsl(35, 35%, 88%);
    --border: hsl(35, 20%, 80%);
    --text-primary: hsl(35, 40%, 12%);
    --text-secondary: hsl(35, 20%, 30%);
    --text-tertiary: hsl(35, 15%, 50%);
    --shadow: 0 4px 20px rgba(70, 50, 20, 0.08);
}

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

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout Utilities */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    padding: 0.3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.theme-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.theme-btn:hover {
    color: var(--text-primary);
}

.theme-btn.active {
    background: var(--primary);
    color: white;
}

/* Input Form & Main Section */
.search-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.input-group {
    flex: 1;
    position: relative;
}

.url-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(265, 85%, 65%, 0.25);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px hsla(265, 85%, 65%, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(265, 85%, 65%, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Articles Section */
.section-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.article-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.article-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.article-title {
    font-size: 1.35rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.3;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-site {
    color: var(--accent);
    font-weight: 500;
}

.article-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.btn-read {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-read:hover {
    color: var(--primary-hover);
    transform: translateX(3px);
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    color: var(--danger);
    background: rgba(255, 0, 0, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- Reader Page Styles --- */
.reader-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.reader-header {
    margin-bottom: 2.5rem;
}

.reader-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2rem;
}

.reader-back:hover {
    color: var(--text-primary);
    transform: translateX(-4px);
}

.reader-title {
    font-size: 2.5rem;
    font-family: var(--font-serif);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.reader-meta {
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
}

/* Simplified Article Body Content Styles */
.reader-content {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.75;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.reader-content p {
    margin-bottom: 1.6rem;
}

.reader-content h1, 
.reader-content h2, 
.reader-content h3, 
.reader-content h4 {
    font-family: var(--font-heading);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
}

.reader-content h1 { font-size: 1.8rem; }
.reader-content h2 { font-size: 1.6rem; }
.reader-content h3 { font-size: 1.4rem; }

.reader-content strong, 
.reader-content b {
    font-weight: 600;
}

.reader-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.reader-content pre {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.reader-content code {
    font-family: monospace;
    background: var(--surface-hover);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.reader-content ul, 
.reader-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.reader-content li {
    margin-bottom: 0.5rem;
}

.reader-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.reader-content th, 
.reader-content td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.reader-content th {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Media & Embed Support */
.reader-content img,
.reader-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.reader-content figure {
    margin: 2.5rem 0;
    text-align: center;
}

.reader-content figure img {
    margin: 0 auto;
}

.reader-content figcaption {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-style: italic;
}

.reader-content iframe {
    display: block;
    margin: 2.5rem auto;
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: none;
}

/* Aspect ratio wrapper for responsive iframe videos */
.reader-content iframe[src*="youtube.com"],
.reader-content iframe[src*="youtu.be"],
.reader-content iframe[src*="vimeo.com"] {
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Loading & Toast States */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(150%);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toast.show {
    transform: translateY(0);
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--accent); }

/* --- Debug Panel Styles --- */
.debug-panel {
    margin-top: 4rem;
    padding: 1.5rem;
    background: hsla(0, 80%, 60%, 0.05);
    border: 1px dashed hsla(0, 80%, 60%, 0.3);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.debug-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 1rem;
}

.debug-header svg {
    color: var(--danger);
    flex-shrink: 0;
}

.debug-body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.debug-error {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.debug-error strong {
    color: var(--text-primary);
    font-weight: 500;
}

.debug-error code {
    display: block;
    margin-top: 0.4rem;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--danger);
}

/* Pulse Animation for Loading */
.pulse {
    animation: pulseKeyframe 1.5s infinite;
}

@keyframes pulseKeyframe {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Hero Image Styling */
.reader-hero {
    width: 100%;
    margin-bottom: 2.5rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.hero-img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.hero-img:hover {
    transform: scale(1.01);
}

@media (max-width: 600px) {
    .search-form {
        flex-direction: column;
    }
    
    .reader-title {
        font-size: 2rem;
    }
}

/* --- Re-fetch and Retry Feature Styling --- */

.article-card.card-error {
    border-color: hsla(0, 80%, 60%, 0.25);
    background: linear-gradient(180deg, var(--surface) 0%, hsla(0, 80%, 60%, 0.015) 100%);
}

.article-card.card-error:hover {
    border-color: var(--danger);
    box-shadow: 0 8px 30px hsla(0, 80%, 60%, 0.12);
}

.error-badge {
    background: hsla(0, 80%, 60%, 0.08);
    color: var(--danger);
    border: 1px solid hsla(0, 80%, 60%, 0.2);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-retry {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-retry:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: hsla(265, 85%, 65%, 0.05);
}

.btn-success-ok {
    background: hsla(140, 70%, 50%, 0.08);
    border: 1px solid hsla(140, 70%, 50%, 0.3);
    color: var(--success);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    animation: okButtonScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-success-ok:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px hsla(140, 70%, 50%, 0.3);
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes okButtonScale {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.reader-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.link-refresh {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.link-refresh:hover {
    color: var(--primary);
}

.link-refresh svg {
    transition: transform 0.3s ease;
}

.link-refresh:hover svg {
    transform: rotate(30deg);
}

/* Redirection Badge */
.redirect-badge {
    display: inline-flex;
    align-items: center;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.15rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: none;
    font-style: normal;
    transition: var(--transition);
    position: relative;
}

.redirect-badge:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: hsla(265, 85%, 65%, 0.05);
}

/* Tooltip container */
.redirect-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow);
    z-index: 10;
}

    z-index: 10;
}

/* Tooltip Caret */
.redirect-badge::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    border: 5px solid transparent;
    border-top-color: var(--border);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 11;
}

/* Show tooltip & caret on hover */
.redirect-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.redirect-badge:hover::before {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
}


/* ==================== USER AUTHENTICATION STYLES ==================== */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 1rem;
}

.landing-section {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.landing-hero h1 {
    font-size: 3.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.15;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.feature-item svg {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.auth-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-tabs {
    display: flex;
    background: var(--background);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.auth-panel {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-panel.active {
    display: flex;
}

/* Google Auth Button */
.auth-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.auth-btn-google:hover {
    border-color: var(--text-secondary);
    background: var(--surface-hover);
    transform: translateY(-1px);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Form Styles */
.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-wrapper {
    display: flex;
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(265, 85%, 65%, 0.2);
}

.auth-btn-submit {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.9rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px hsla(265, 85%, 65%, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(265, 85%, 65%, 0.35);
}

.auth-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Profile Dropdown Widget */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-widget {
    position: relative;
}

.profile-trigger {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.profile-trigger:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.profile-avatar-placeholder {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.profile-dropdown-card {
    position: absolute;
    top: 130%;
    right: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    padding: 1.5rem;
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 100;
    animation: dropdownShow 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.profile-dropdown-card.show {
    display: flex;
}

@keyframes dropdownShow {
    0% { transform: translateY(10px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.profile-header-info {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.profile-id-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 0.2rem;
}

.profile-id-val {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    word-break: break-all;
}

.profile-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.provider-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.provider-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.provider-status {
    display: flex;
    flex-direction: column;
}

.provider-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.provider-id-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-not-connected {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.btn-provider-action {
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-provider-action.connect {
    color: var(--accent);
    background: hsla(180, 80%, 45%, 0.1);
}

.btn-provider-action.connect:hover {
    background: var(--accent);
    color: var(--background);
}

.btn-provider-action.disconnect {
    color: var(--danger);
    background: hsla(0, 80%, 60%, 0.1);
}

.btn-provider-action.disconnect:hover {
    background: var(--danger);
    color: white;
}

.btn-signout {
    width: 100%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-signout:hover {
    background: hsla(0, 80%, 60%, 0.05);
    border-color: var(--danger);
    color: var(--danger);
}

/* Skeleton Loading for Cards */
.skeleton-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: none;
}

.skeleton-title {
    height: 1.5rem;
    background: var(--border);
    border-radius: var(--radius-sm);
    width: 75%;
}

.skeleton-meta {
    height: 1rem;
    background: var(--border);
    border-radius: var(--radius-sm);
    width: 40%;
}

.skeleton-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.skeleton-btn {
    height: 1.5rem;
    background: var(--border);
    border-radius: var(--radius-sm);
    width: 100px;
}

/* Modal Overlay for Phone Authentication linking (Prompt replacement) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
}

@media (max-width: 768px) {
    .landing-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .landing-hero h1 {
        font-size: 2.5rem;
    }
    
    .feature-item {
        justify-content: center;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
}



