/* ScrollFeed Pro Public Styles */

:root {
    --sfp-bg-color: #ffffff;
    --sfp-text-main: #111827;
    --sfp-text-muted: #6b7280;
    --sfp-border: #f3f4f6;
    --sfp-card-bg: #ffffff;
    --sfp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --sfp-primary: #8b5cf6; /* Can be overridden inline */
    --sfp-radius: 16px; /* Can be overridden inline */
    --sfp-icon-color: #4b5563;
    --sfp-nav-bg: #ffffff;
}

[data-theme="dark"] {
    --sfp-bg-color: #111827;
    --sfp-text-main: #f9fafb;
    --sfp-text-muted: #9ca3af;
    --sfp-border: #374151;
    --sfp-card-bg: #1f2937;
    --sfp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --sfp-icon-color: #d1d5db;
    --sfp-nav-bg: #1f2937;
}

.sfp-mobile-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    width: 100%;
}

.sfp-container {
    width: 100%;
    max-width: 480px;
    height: 85vh; /* Mobile app feel */
    max-height: 850px;
    min-height: 600px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    background-color: var(--sfp-bg-color);
    color: var(--sfp-text-main);
    border-radius: 30px; /* Stronger radius for app mockup look on desktop */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--sfp-shadow);
    border: 8px solid #f3f4f6; /* Mock device frame */
}

[data-theme="dark"] .sfp-container {
    border-color: #374151;
}

/* Full screen on actual mobile devices */
@media (max-width: 480px) {
    .sfp-mobile-wrapper {
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999999;
        background: var(--sfp-bg-color);
    }
    .sfp-container {
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
}

/* Header */
.sfp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sfp-border);
    background: var(--sfp-bg-color);
    z-index: 20;
    position: relative;
}

.sfp-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sfp-logo-icon {
    background: var(--sfp-primary);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
}

.sfp-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--sfp-text-main);
}

.sfp-theme-toggle {
    background: none;
    border: none;
    color: var(--sfp-text-main);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.sfp-theme-toggle:hover {
    background: var(--sfp-border);
}

/* Tabs */
.sfp-tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid var(--sfp-border);
    background: var(--sfp-bg-color);
    z-index: 20;
    position: relative;
}

.sfp-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    background: none;
    border: none;
    color: var(--sfp-text-muted);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.sfp-tab.active {
    color: var(--sfp-text-main);
}

.sfp-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--sfp-primary);
    border-radius: 3px 3px 0 0;
}

/* Scroll Area */
.sfp-feed-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
}

.sfp-feed-scroll-area::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sfp-feed {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sfp-bottom-spacer {
    height: 100px; /* Increased space for bottom nav + safe areas */
}

/* Cards */
.sfp-card {
    background: var(--sfp-card-bg);
    border-radius: var(--sfp-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--sfp-border);
}

.sfp-card-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.sfp-card-header-no-img {
    padding: 16px 16px 0 16px;
}

.sfp-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--sfp-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sfp-card-header-no-img .sfp-category-badge {
    position: static;
    display: inline-block;
}

.sfp-card-content {
    padding: 16px;
}

.sfp-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.sfp-card-title a {
    color: var(--sfp-text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.sfp-card-title a:hover {
    color: var(--sfp-primary);
}

.sfp-card-meta {
    display: flex;
    align-items: center;
    color: var(--sfp-text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}
.sfp-author-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.sfp-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--sfp-border);
}
.sfp-author {
    font-weight: 600;
    color: var(--sfp-text-main);
}
.sfp-card-follow-btn {
    background: transparent;
    color: var(--sfp-primary);
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s;
}
.sfp-card-follow-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}
.sfp-card-follow-btn.following {
    color: var(--sfp-text-muted);
    font-weight: 500;
}

.sfp-dot {
    margin: 0 6px;
}

.sfp-card-excerpt {
    color: var(--sfp-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Actions */
.sfp-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--sfp-border);
}

.sfp-actions-left {
    display: flex;
    gap: 16px;
}

.sfp-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--sfp-icon-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.2s, transform 0.1s;
}

.sfp-action-btn:hover {
    color: var(--sfp-primary);
}

.sfp-action-btn:active {
    transform: scale(0.95);
}

.sfp-action-btn.active {
    color: #ef4444; /* Heart red */
}
.sfp-action-btn.active svg {
    fill: #ef4444;
    animation: sfp-pulse 0.4s ease-in-out;
}
.sfp-bookmark-btn.active {
    color: var(--sfp-primary);
}
.sfp-bookmark-btn.active svg {
    fill: var(--sfp-primary);
    animation: none;
}

@keyframes sfp-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Liked By Avatars */
.sfp-liked-by {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--sfp-text-main);
}
.sfp-liked-avatars {
    display: flex;
    margin-right: 8px;
}
.sfp-liked-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--sfp-card-bg);
    margin-left: -6px;
    background: var(--sfp-border);
    object-fit: cover;
}
.sfp-liked-avatar:first-child {
    margin-left: 0;
}
.sfp-liked-text {
    font-weight: 500;
}
.sfp-liked-text span {
    font-weight: 700;
}

/* Bottom Navigation */
.sfp-bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--sfp-nav-bg);
    border-top: 1px solid var(--sfp-border);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 30;
    box-sizing: border-box;
    width: 100%;
    max-width: 480px; /* Match container max-width */
    margin: 0 auto;
}

.sfp-nav-item {
    flex: 1 1 0%; /* Critical: Force equal width grow/shrink from 0 basis */
    min-width: 0;   /* Critical: Allow shrinking below content size */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--sfp-text-muted);
    gap: 2px; /* Slightly tighter gap for small screens */
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    padding: 0 4px;
    box-sizing: border-box;
}

.sfp-nav-item span {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.sfp-nav-item svg {
    width: 22px; /* Slightly smaller for better fit */
    height: 22px;
    flex-shrink: 0;
}

.sfp-nav-item:hover, .sfp-nav-item.active {
    color: var(--sfp-primary);
}

.sfp-nav-item.sfp-nav-primary {
    position: relative;
    top: -15px; /* Slightly less extreme offset */
    flex: 1 1 0%; /* Keep identical flex weight to maintain balance */
    overflow: visible; /* Allow FAB to pop out */
}

.sfp-nav-fab {
    width: 52px; /* Slightly refined size */
    height: 52px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid var(--sfp-nav-bg);
    flex-shrink: 0;
}

.sfp-nav-fab svg {
    width: 26px;
    height: 26px;
    color: white;
}

.sfp-nav-primary:active .sfp-nav-fab {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

/* Sidebar Menu */
.sfp-sidebar-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sfp-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sfp-sidebar {
    position: absolute;
    top: 0; left: -280px; bottom: 0;
    width: 280px;
    background: var(--sfp-bg-color);
    z-index: 50;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sfp-sidebar.active {
    left: 0;
}

.sfp-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sfp-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sfp-sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--sfp-border);
    object-fit: cover;
}
.sfp-sidebar-user-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--sfp-text-main);
}
.sfp-sidebar-user-info p {
    margin: 0;
    font-size: 13px;
    color: var(--sfp-text-muted);
}

.sfp-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}
.sfp-menu-section {
    padding: 10px 0;
    border-bottom: 1px solid var(--sfp-border);
}
.sfp-menu-section:last-child {
    border-bottom: none;
}
.sfp-menu-label {
    display: block;
    padding: 0 20px 10px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--sfp-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sfp-sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    color: var(--sfp-text-main);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}
.sfp-sidebar-item:hover {
    background: var(--sfp-border);
}
.sfp-sidebar-item svg {
    color: var(--sfp-icon-color);
}

.sfp-hamburger {
    background: none;
    border: none;
    color: var(--sfp-text-main);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Spinner */
.sfp-loading-spinner {
    text-align: center;
    padding: 20px;
    color: var(--sfp-text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 30px;
    height: 30px;
    animation: rotate 2s linear infinite;
}

.spinner circle {
    stroke: var(--sfp-primary);
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
    stroke-linecap: round;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}
@keyframes dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 200; stroke-dashoffset: -35px; }
    100% { stroke-dasharray: 90, 200; stroke-dashoffset: -124px; }
}

/* Skeleton Loading */
.sfp-skeleton-card {
    background: var(--sfp-card-bg);
    border-radius: var(--sfp-radius);
    overflow: hidden;
    border: 1px solid var(--sfp-border);
}

.sfp-skeleton-img {
    height: 220px;
    background: var(--sfp-border);
    animation: pulse 1.5s infinite;
}

.sfp-skeleton-text {
    height: 20px;
    background: var(--sfp-border);
    margin: 16px;
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

.sfp-skeleton-text.short {
    width: 60%;
    margin-top: 0;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Auth Modal */
.sfp-auth-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sfp-auth-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.sfp-auth-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: var(--sfp-bg-color);
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 101;
    padding: 30px 20px;
}
.sfp-auth-close {
    position: absolute;
    top: 15px; right: 15px;
    background: none; border: none;
    font-size: 24px; color: var(--sfp-text-muted);
    cursor: pointer;
}
.sfp-auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--sfp-border);
}
.sfp-auth-tab {
    flex: 1; background: none; border: none;
    padding: 12px 0; font-size: 16px; font-weight: 600;
    color: var(--sfp-text-muted); cursor: pointer;
    position: relative;
}
.sfp-auth-tab.active {
    color: var(--sfp-text-main);
}
.sfp-auth-tab.active::after {
    content: ''; position: absolute; bottom: 0; left: 10%; right: 10%;
    height: 3px; background: var(--sfp-primary); border-radius: 3px 3px 0 0;
}
.sfp-form-group {
    margin-bottom: 16px;
}
.sfp-form-group label {
    display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500;
    color: var(--sfp-text-muted);
}
.sfp-form-group input {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--sfp-border); border-radius: 12px;
    background: var(--sfp-card-bg); color: var(--sfp-text-main);
    font-size: 15px; outline: none; transition: border-color 0.2s;
    box-sizing: border-box;
}
.sfp-form-group input:focus {
    border-color: var(--sfp-primary);
}
.sfp-form-options {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; font-size: 13px; color: var(--sfp-text-muted);
}
.sfp-forgot-pwd {
    color: var(--sfp-primary); text-decoration: none;
}
.sfp-btn {
    display: flex; justify-content: center; align-items: center;
    padding: 14px; border-radius: 12px; border: none; font-size: 16px;
    font-weight: 600; cursor: pointer; transition: transform 0.1s, opacity 0.2s;
}
.sfp-btn-primary {
    background: var(--sfp-primary); color: white;
}
.sfp-btn-block {
    width: 100%;
}
.sfp-btn:active {
    transform: scale(0.98);
}
.sfp-auth-message {
    margin-top: 16px; font-size: 14px; text-align: center;
}
.sfp-auth-message.error { color: #ef4444; }
.sfp-auth-message.success { color: #10b981; }

/* Account Type Selection */
.sfp-type-card {
    flex: 1;
    border: 2px solid var(--sfp-border);
    border-radius: var(--sfp-radius);
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--sfp-card-bg);
}

.sfp-type-card.active {
    border-color: var(--sfp-primary);
    background-color: rgba(139, 92, 246, 0.05);
}

/* SPA Views */
.sfp-view-panel {
    width: 100%;
    max-width: 480px;
    height: 100%;
    position: absolute;
    top: 0; 
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background-color: var(--sfp-bg-color);
}

.sfp-back-btn {
    background: none; border: none; color: var(--sfp-text-main);
    cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center;
}

.sfp-header-title {
    font-size: 18px; font-weight: 700; color: var(--sfp-text-main); text-align: center;
}

/* Submit Form */
.sfp-submit-container {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}
.sfp-image-upload-wrapper {
    position: relative;
    width: 100%; height: 180px;
    border: 2px dashed var(--sfp-border);
    border-radius: 12px;
    background: var(--sfp-card-bg);
    overflow: hidden;
    cursor: pointer;
}
.sfp-file-input {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2;
}
.sfp-image-preview {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--sfp-text-muted); gap: 10px; z-index: 1;
    background-size: cover; background-position: center;
}
.sfp-submit-message {
    margin-top: 16px; font-size: 14px; text-align: center;
}
.sfp-submit-message.error { color: #ef4444; }
.sfp-submit-message.success { color: #10b981; }

/* Profile View */
.sfp-profile-scroll-area {
    flex: 1; overflow-y: auto; scrollbar-width: none;
}
.sfp-profile-scroll-area::-webkit-scrollbar { display: none; }
.sfp-profile-header {
    padding: 30px 20px; text-align: center; border-bottom: 1px solid var(--sfp-border);
}
.sfp-profile-avatar-large {
    width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--sfp-primary);
    object-fit: cover; margin-bottom: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.sfp-profile-name { margin: 0 0 4px 0; font-size: 22px; font-weight: 700; }
.sfp-profile-handle { margin: 0 0 20px 0; color: var(--sfp-text-muted); font-size: 14px; }

.sfp-profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 20px 20px 20px;
}
.sfp-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--sfp-card-bg);
    border: 1px solid var(--sfp-border);
    border-radius: 16px;
    padding: 16px 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
[data-theme="dark"] .sfp-stat-box {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.sfp-stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
[data-theme="dark"] .sfp-stat-box:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.sfp-stat-val { font-size: 18px; font-weight: 800; color: var(--sfp-text-main); }
.sfp-stat-label { font-size: 11px; color: var(--sfp-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

.sfp-profile-content { padding: 0; }
.sfp-empty-state { text-align: center; padding: 40px 20px; color: var(--sfp-text-muted); }
.sfp-empty-state h3 { color: var(--sfp-text-main); margin: 16px 0 8px 0; }
.sfp-empty-state button { margin-top: 20px; max-width: 200px; margin-left: auto; margin-right: auto; }

/* Profile Improvements & Glow */
.sfp-centered-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sfp-profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 16px;
    border-radius: 50%;
    cursor: pointer;
}
.sfp-avatar-glow {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    background: linear-gradient(var(--sfp-card-bg), var(--sfp-card-bg)) padding-box,
                linear-gradient(135deg, #a855f7, #ec4899, #3b82f6) border-box;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    margin: 0;
}
.sfp-avatar-edit-overlay {
    position: absolute;
    bottom: 0; right: 0;
    width: 32px; height: 32px;
    background: var(--sfp-primary);
    color: white;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    border: 3px solid var(--sfp-bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Follow Button */
.sfp-follow-btn {
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
}
.sfp-follow-btn.following {
    background: transparent;
    color: var(--sfp-text-main);
    border: 1px solid var(--sfp-border);
}

/* Earnings Dashboard */
.sfp-earnings-container {
    padding: 20px;
}
.sfp-earnings-cards {
    display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px;
}
.sfp-earning-card {
    padding: 24px; border-radius: var(--sfp-radius);
    text-align: center; color: white;
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    box-shadow: 0 8px 20px rgba(147, 51, 234, 0.3);
}
.sfp-earning-card h4 { margin: 0 0 10px 0; font-size: 14px; opacity: 0.9; font-weight: 500; }
.sfp-earning-amount { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.sfp-withdraw-btn {
    background: white; color: #4f46e5; border-radius: 30px; font-weight: 700;
    padding: 10px 24px; display: inline-block; width: auto;
}
.sfp-earning-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.sfp-stat-card {
    background: var(--sfp-card-bg); padding: 16px; border-radius: var(--sfp-radius);
    border: 1px solid var(--sfp-border); text-align: center;
}
.sfp-stat-card h5 { margin: 0 0 8px 0; font-size: 12px; color: var(--sfp-text-muted); font-weight: 500; }
.sfp-stat-card .sfp-stat-val { font-size: 20px; color: var(--sfp-text-main); font-weight: 700; }
.sfp-section-title { font-size: 16px; margin: 0 0 16px 0; font-weight: 700; }

/* Comments Bottom Sheet */
.sfp-bottom-sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sfp-bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}
.sfp-bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: 75vh;
    background: var(--sfp-bg-color);
    border-radius: 20px 20px 0 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    transition: bottom 0.3s cubic-bezier(0.1, 0.8, 0.3, 1);
}
.sfp-bottom-sheet.active {
    bottom: 0;
}
[data-theme="dark"] .sfp-bottom-sheet {
    box-shadow: 0 -10px 25px rgba(0,0,0,0.5);
}
.sfp-bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sfp-border);
}
.sfp-bottom-sheet-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    flex: 1;
}
.sfp-close-comments-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--sfp-text-muted);
    cursor: pointer;
    padding: 0 5px;
}
.sfp-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.sfp-comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.sfp-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sfp-border);
    flex-shrink: 0;
}
.sfp-comment-body {
    flex: 1;
    background: var(--sfp-card-bg);
    padding: 12px 16px;
    border-radius: 0 16px 16px 16px;
    border: 1px solid var(--sfp-border);
}
.sfp-comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.sfp-comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--sfp-text-main);
}
.sfp-comment-time {
    font-size: 11px;
    color: var(--sfp-text-muted);
}
.sfp-comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--sfp-text-main);
}
.sfp-comment-input-area {
    padding: 12px 20px;
    border-top: 1px solid var(--sfp-border);
    background: var(--sfp-bg-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
}
.sfp-comment-form-inner {
    display: flex;
    gap: 10px;
    align-items: center;
}
.sfp-comment-form-inner input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid var(--sfp-border);
    background: var(--sfp-card-bg);
    color: var(--sfp-text-main);
    outline: none;
    transition: all 0.3s ease;
}
.sfp-comment-form-inner input:focus {
    border-color: var(--sfp-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.sfp-comment-submit {
    background: var(--sfp-primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}
.sfp-comment-submit:hover {
    background: #4f46e5;
}
.sfp-comment-submit:active {
    transform: scale(0.9);
}

/* Floating Labels & Auth Enhancements */
.sfp-floating-group {
    position: relative;
    margin-bottom: 24px;
}

.sfp-floating-input {
    width: 100%;
    padding: 16px 16px;
    font-size: 15px;
    border: 1.5px solid var(--sfp-border);
    border-radius: 14px;
    background: var(--sfp-card-bg);
    color: var(--sfp-text-main);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.sfp-floating-input:focus {
    border-color: var(--sfp-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.sfp-floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sfp-text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 4px;
}

.sfp-floating-input:focus ~ .sfp-floating-label,
.sfp-floating-input:not(:placeholder-shown) ~ .sfp-floating-label {
    top: 0;
    font-size: 12px;
    color: var(--sfp-primary);
    background: var(--sfp-card-bg);
    font-weight: 600;
}

.sfp-btn-pill {
    border-radius: 30px;
}

.sfp-btn-loader {
    display: none;
}

.sfp-btn-loader .spinner {
    width: 24px;
    height: 24px;
    margin: 0;
}

.sfp-btn-loader .spinner circle {
    stroke: white;
}

.sfp-auth-footer {
    margin-top: 24px;
    text-align: center;
}

.sfp-back-to-login {
    font-size: 14px;
    font-weight: 600;
    color: var(--sfp-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.sfp-back-to-login:hover {
    opacity: 0.8;
}

.sfp-auth-message {
    margin-top: 20px;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.sfp-auth-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.sfp-auth-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
