/* ===== CORE APPLICATION STYLES ===== */

/* Brand Colors & Typography */
:root {
    --brand-navy: #1a3d5c;
    --brand-amber: #d4941e;
    --brand-light: #f5f3f0;
    --brand-white: #ffffff;
    --brand-text: #333333;
    --brand-muted: #666666;
    --brand-border: #e0e0e0;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Typography */
body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    color: var(--brand-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure main content takes up available space */
main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--brand-text);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Main Navigation */
.main-nav {
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
    padding: 1rem 0;
    margin-bottom: 0; /* Remove margin to blend with hero */
    box-shadow: none; /* Remove shadow for seamless look */
    border-bottom: 1px solid var(--brand-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    min-height: 60px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-navy);
    text-decoration: none;
    flex-shrink: 0;
    margin-right: auto;
}

.logo-img {
    height: 32px;
    width: auto;
}

.user-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--brand-navy);
    flex-shrink: 0;
    margin-left: auto;
}

.user-menu a {
    color: var(--brand-navy);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.user-menu a:hover {
    background-color: var(--brand-light);
}

/* User Profile Card in Navigation */
.nav-user-profile-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-left: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-user-profile-card:hover {
    background: var(--brand-light);
    border-color: var(--brand-amber);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--brand-border);
}

.nav-user-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 1px solid var(--brand-border);
    color: var(--brand-white);
}

.nav-user-name {
    font-weight: 500;
    color: var(--brand-text);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    flex: 1;
}

.nav-logout-icon {
    color: var(--brand-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.2rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
}

.nav-logout-icon:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    transform: scale(1.1);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--brand-navy);
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.mobile-menu-toggle:hover {
    background: var(--brand-light);
    color: var(--brand-amber);
    transform: scale(1.05);
}

.mobile-menu-toggle:focus {
    outline: none;
    background: var(--brand-light);
    color: var(--brand-amber);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
    background: var(--brand-amber);
    color: var(--brand-navy);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--brand-white);
    padding: 1rem;
    border-top: 1px solid var(--brand-border);
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--brand-navy);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
}

.mobile-menu a:hover {
    background-color: var(--brand-light);
}

.login-btn {
    background: var(--brand-amber);
    color: var(--brand-navy);
    font-weight: 600;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(212, 148, 30, 0.2);
    transition: all 0.2s ease;
    border: none;
    text-transform: none;
    font-size: 0.95rem;
}

.login-btn:hover {
    background: #c08419;
    color: var(--brand-navy);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(212, 148, 30, 0.3);
}

/* Bookshelf Grid */
.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Clickable Bookshelf Card Link */
.bookshelf-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.bookshelf-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: inherit;
    text-decoration: none;
}

.bookshelf-card-link:focus {
    outline: 3px solid var(--brand-amber);
    outline-offset: 2px;
}

.bookshelf-card-link:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Bookshelf Card Content */
.bookshelf-card-content {
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    background: var(--brand-white);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bookshelf-card-link:hover .bookshelf-card-content {
    border-color: var(--brand-amber);
    background: linear-gradient(135deg, var(--brand-white) 0%, var(--brand-light) 100%);
}

/* Ensure card content fills the link properly */
.bookshelf-card-content h3 {
    margin-top: 0;
    color: var(--brand-navy);
    font-weight: 600;
    transition: color 0.2s ease;
}

.bookshelf-card-link:hover .bookshelf-card-content h3 {
    color: var(--brand-amber);
}

/* Shelf badges styling - improved alignment and consistency */
.shelf-badges {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 0 0;
    flex-wrap: wrap;
    align-items: center;
    min-height: 32px; /* Consistent height to prevent layout shifts */
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--brand-light) 0%, #e9ecef 100%);
    color: var(--brand-text);
    border: 1px solid var(--brand-border);
    margin: 0;
    height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.privacy-badge:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--brand-amber);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.contribution-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    margin: 0;
    height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.2);
    transition: all 0.2s ease;
}

.contribution-badge:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

/* Book Grid - Mobile First Approach */
.book-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 1rem 0;
    margin: 2rem 0;
    -webkit-overflow-scrolling: touch;
}

.book-card {
    position: relative;
    flex: 0 0 140px;
    scroll-snap-align: start;
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--brand-white);
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Tablet breakpoint */
@media (min-width: 481px) {
    .book-card {
        flex: 0 0 160px;
    }
}

/* Desktop breakpoint */
@media (min-width: 768px) {
    .book-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        overflow-x: visible;
        scroll-snap-type: none;
    }
    
    .book-card {
        flex: none;
    }
}

/* Shelf Header */
.shelf-header-card {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 0.5rem;
}

.shelf-title {
    color: var(--brand-navy);
    margin-bottom: 0.5rem;
}

.shelf-description {
    color: var(--brand-muted);
    margin-bottom: 1rem;
}

.shelf-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--brand-muted);
}

    .shelf-badges {
        margin: 0.5rem 0 0 0;
        gap: 0.25rem;
        min-height: 26px;
    }
    
    .privacy-badge,
    .contribution-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        height: 26px;
    }

/* Action Button Styles */
.action-btn {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    color: var(--brand-text);
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border-color: var(--brand-amber);
}

.manage-btn {
    font-size: 1.1rem;
}

/* Enhanced Empty State */
.empty-state-card {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--brand-light);
    border: 2px dashed var(--brand-border);
    border-radius: 0.5rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--brand-navy);
}

.empty-description {
    color: var(--brand-muted);
    margin-bottom: 2rem;
}

/* Add Books Interface */
#add-books-container {
    margin-bottom: 2rem;
}

.add-books-toggle {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.book-search-expanded .card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

.search-form-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-form-row input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
}

.search-form-row button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    white-space: nowrap;
}

/* Book Card Components - Mobile First */
.book-cover-container {
    height: 140px;
    overflow: hidden;
    position: relative;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-border);
    color: var(--brand-muted);
    font-size: 2rem;
}

.book-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.book-title {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--brand-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
}

.book-author {
    margin: 0;
    color: var(--brand-muted);
    font-size: 0.75rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-description {
    margin: 0;
    font-size: 0.7rem;
    color: var(--brand-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Voting System */
.book-voting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}

.voting-buttons {
    display: flex;
    gap: 0.25rem;
}

.vote-btn {
    background: none;
    border: 1px solid var(--brand-border);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.vote-btn:hover:not(:disabled) {
    background: var(--brand-light);
    border-color: var(--brand-amber);
}

.vote-btn.voted {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border-color: var(--brand-amber);
}

.vote-btn.disabled,
.vote-btn:disabled {
    background: var(--brand-light);
    color: var(--brand-muted);
    border-color: var(--brand-border);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Permission-aware voting button states */
.vote-btn.disabled-anonymous {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: var(--brand-navy);
    border: 2px solid #2196f3;
    cursor: pointer;
    opacity: 0.9;
    font-weight: 600;
    transition: all 0.3s ease;
}

.vote-btn.disabled-anonymous:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #e1bee7 100%);
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.vote-btn.disabled-no-permission {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    cursor: not-allowed;
    opacity: 0.8;
    font-weight: 500;
}

.vote-btn.disabled-no-permission:hover {
    background: #ffeaa7;
    border-color: #e0a800;
}

/* Permission-aware voting button states */
.vote-btn.disabled-anonymous {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: var(--brand-navy);
    border: 2px solid #2196f3;
    cursor: pointer;
    opacity: 0.9;
    font-weight: 600;
    transition: all 0.3s ease;
}

.vote-btn.disabled-anonymous:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #e1bee7 100%);
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.vote-btn.disabled-no-permission {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    cursor: not-allowed;
    opacity: 0.8;
    font-weight: 500;
}

.vote-btn.disabled-no-permission:hover {
    background: #ffeaa7;
    border-color: #e0a800;
}

.vote-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-text);
    min-width: 20px;
    text-align: center;
}

/* Remove Button (Red Cross) */
.remove-btn-cross {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 24px;
    height: 24px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.remove-btn-cross:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* More Info Link */
.more-info-link {
    font-size: 0.7rem;
    color: var(--brand-amber);
    text-decoration: none;
    text-align: center;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.more-info-link:hover {
    background: var(--brand-light);
    color: var(--brand-navy);
    text-decoration: underline;
}

/* Tablet Responsive */
@media (min-width: 481px) {
    .book-cover-container {
        height: 160px;
    }
    
    .book-info {
        padding: 1rem;
    }
    
    .book-title {
        font-size: 0.9rem;
        min-height: 2.8rem;
    }
    
    .book-author {
        font-size: 0.8rem;
    }
    
    .book-description {
        font-size: 0.75rem;
    }
    
    .remove-btn-cross {
        width: 28px;
        height: 28px;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .more-info-link {
        font-size: 0.75rem;
    }
}

/* Desktop Responsive */
@media (min-width: 768px) {
    .book-cover-container {
        height: 180px;
    }
    
    .book-title {
        font-size: 1rem;
        min-height: 3rem;
    }
    
    .book-author {
        font-size: 0.85rem;
    }
    
    .book-description {
        font-size: 0.8rem;
    }
    
    .vote-btn {
        min-width: 36px;
        min-height: 36px;
        font-size: 0.8rem;
    }
    
    .vote-count {
        font-size: 0.8rem;
    }
    
    .remove-btn-cross {
        width: 32px;
        height: 32px;
    }
    
    .more-info-link {
        font-size: 0.8rem;
    }
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--muted-border-color);
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.search-result-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--muted-border-color);
}

.search-result-card:last-child {
    border-bottom: none;
}

.search-result-cover-container {
    flex-shrink: 0;
    width: 80px;
    height: 120px;
}

.search-result-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.25rem;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted-color);
    border-radius: 0.25rem;
    font-size: 2rem;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-book-btn {
    align-self: flex-start;
    margin-top: auto;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #363;
}

.alert-info {
    background: #eef;
    border: 1px solid #ccf;
    color: #336;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-color);
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--brand-border);
    border-top: 2px solid var(--brand-amber);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Search form improvements */
.search-form {
    margin-bottom: 1rem;
}

.search-form input {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* HTMX indicator styling */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Share Interface */
.share-interface {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.privacy-section, .members-section, .pending-section, .invite-section {
    border: 1px solid var(--muted-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.current-privacy {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}

.privacy-info p {
    color: var(--muted-color);
    margin: 0;
}

.privacy-form {
    margin-top: 1rem;
}

/* Member Cards */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--muted-border-color);
    border-radius: 0.5rem;
    background: var(--background-color);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--muted-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.member-info {
    flex: 1;
}

.member-name {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.member-handle {
    margin: 0 0 0.5rem 0;
    color: var(--muted-color);
    font-size: 0.9rem;
}

.member-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.member-controls select {
    min-width: 100px;
}

.member-controls .small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-owner {
    background: #ffd700;
    color: #000;
}

.badge-moderator {
    background: #dc3545;
    color: white;
}

.badge-contributor {
    background: #007bff;
    color: white;
}

.badge-viewer {
    background: #6c757d;
    color: white;
}

.badge-pending {
    background: #ffc107;
    color: #000;
}

/* Contribution Badges */
.contribution-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    margin-left: 0.5rem;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.2);
    transition: all 0.2s ease;
}

.contribution-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.shelf-preview-contribution-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    margin-bottom: 0.25rem;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.2);
    transition: all 0.2s ease;
}

.shelf-preview-contribution-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

/* Enhanced Role Management Styles */
.role-display {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.role-controls-read {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.role-controls-edit {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--brand-light);
    border: 2px solid var(--brand-amber);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(212, 148, 30, 0.2);
}

.role-controls-confirm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.role-select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.25rem;
    font-size: 0.9rem;
    background: var(--brand-white);
    transition: border-color 0.2s ease;
}

.role-select:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 2px rgba(212, 148, 30, 0.2);
}

.role-edit-buttons,
.role-confirm-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.edit-role-btn,
.save-role-btn,
.confirm-role-btn {
    transition: all 0.2s ease;
}

.edit-role-btn:hover {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border-color: var(--brand-amber);
}

.save-role-btn {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border: none;
}

.save-role-btn:hover {
    background: #c08419;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(212, 148, 30, 0.3);
}

.confirm-role-btn {
    background: #28a745;
    color: white;
    border: none;
}

.confirm-role-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.cancel-role-btn {
    background: var(--brand-white);
    color: var(--brand-muted);
    border: 1px solid var(--brand-border);
}

.cancel-role-btn:hover {
    background: var(--brand-light);
    color: var(--brand-text);
}

.remove-member-btn {
    background: var(--brand-white);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.remove-member-btn:hover {
    background: #dc3545;
    color: white;
}

.role-change-preview {
    text-align: center;
    margin-bottom: 0.75rem;
}

.role-change-confirmation {
    font-weight: 600;
    color: var(--brand-text);
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.role-change-description {
    color: var(--brand-muted);
    font-size: 0.85rem;
    margin: 0;
    font-style: italic;
}

/* Loading states for role changes */
.htmx-request .role-controls-edit,
.htmx-request .role-controls-confirm {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request .save-role-btn,
.htmx-request .confirm-role-btn {
    position: relative;
}

.htmx-request .save-role-btn::after,
.htmx-request .confirm-role-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success highlight animation */
.member-card.role-updated {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    transition: all 0.3s ease;
}

/* Mobile responsive for role management */
@media (max-width: 768px) {
    .role-controls-read {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .role-edit-buttons,
    .role-confirm-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .role-select {
        font-size: 0.85rem;
    }
    
    .role-change-confirmation {
        font-size: 0.9rem;
    }
    
    .role-change-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .role-controls-edit,
    .role-controls-confirm {
        padding: 0.5rem;
    }
    
    .role-edit-buttons,
    .role-confirm-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .edit-role-btn,
    .save-role-btn,
    .confirm-role-btn,
    .cancel-role-btn,
    .remove-member-btn {
        width: 100%;
        text-align: center;
    }
}

/* Invite Interface */
.invite-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.invite-card {
    border: 1px solid var(--muted-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--background-color);
}

.invite-info {
    margin-bottom: 1rem;
}

.invite-info strong {
    display: block;
    margin-bottom: 0.5rem;
}

.invite-info p {
    margin: 0.25rem 0;
    color: var(--muted-color);
    font-size: 0.9rem;
}

.invite-url-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.invite-url {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    background: var(--muted-color);
    border: 1px solid var(--muted-border-color);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.empty-message {
    color: var(--muted-color);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* ===== LANDING PAGE STYLES ===== */

/* Hero Section */
.hero-section {
    background: transparent; /* Remove background, now handled by nav */
    color: var(--brand-navy);
    padding: 4rem 0;
    margin-bottom: 0;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content {
    text-align: left;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-cta {
    background: var(--brand-amber);
    color: var(--brand-navy);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: var(--brand-navy);
}

.hero-cta-secondary {
    background: transparent;
    color: var(--brand-navy);
    border: 2px solid var(--brand-navy);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}

.hero-cta-secondary:hover {
    background: var(--brand-navy);
    color: white;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo {
    max-width: 200px;
    height: auto;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

.hero-icon {
    font-size: 8rem;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-description {
    color: #666;
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works-section {
    padding: 4rem 0;
    background: white;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.step-card {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--brand-navy) 0%, #2a5a7a 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem auto;
}

.step-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.step-description {
    color: #666;
    line-height: 1.5;
}

/* Public Shelves Section */
.public-shelves-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.section-cta {
    text-align: center;
    margin-top: 2rem;
}

/* Landing Footer */
.landing-footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 0;
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: #ccc;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.footer-text a {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 600;
}

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

.footer-copyright {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

.footer-social {
    text-align: center;
    margin: 1rem 0;
}

.social-icon {
    color: var(--brand-amber);
    font-size: 1.5rem;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.social-icon:hover {
    color: var(--brand-white);
}

/* Container for landing page */
.landing-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    /* Fix search form for mobile */
    .search-form-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-form-row input {
        flex: none;
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        border: 2px solid var(--brand-border);
        min-height: 44px;
    }
    
    .search-form-row button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
        border-radius: 0.5rem;
    }
    
    .search-btn, .cancel-btn {
        width: 100%;
    }
    
    /* Improve add books card spacing */
    .add-books-card {
        padding: 1.5rem;
        margin: 0 -1rem;
    }
    
    /* Navigation */
    .desktop-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-container {
        flex-wrap: nowrap;
        min-height: 60px;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
        margin-right: 0;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .user-menu {
        flex-shrink: 0;
        gap: 0.5rem;
    }
    
    .login-btn {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.9rem;
    }
    
    /* Mobile user profile card */
    .nav-user-profile-card {
        margin-left: 0;
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
    }
    
    .nav-user-avatar,
    .nav-user-avatar-placeholder {
        width: 28px;
        height: 28px;
    }
    
    .nav-user-name {
        font-size: 0.85rem;
        max-width: 80px;
    }
    
    .nav-logout-icon {
        font-size: 1rem;
        min-width: 20px;
        min-height: 20px;
        padding: 0.2rem;
    }
    
    /* Grids */
    .bookshelf-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile bookshelf card adjustments */
    .bookshelf-card-link {
        border-radius: 0.75rem;
    }
    
    .bookshelf-card-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }
    
    .bookshelf-card-content {
        padding: 1.25rem;
        border-radius: 0.75rem;
        min-height: 120px;
    }
    
    .bookshelf-card-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .shelf-badges {
        margin: 0.75rem 0 0 0;
        gap: 0.375rem;
        min-height: 28px;
    }
    
    .privacy-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        height: 28px;
    }
    
    .contribution-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        height: 28px;
    }

    .book-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .book-card {
        flex: 0 0 140px; /* Fixed width for mobile */
        scroll-snap-align: start;
    }
    
    /* Ensure touch targets are large enough on mobile */
    .vote-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 0.8rem;
    }
    
    .remove-btn-cross {
        width: 32px;
        height: 32px;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .more-info-link {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .search-result-card {
        flex-direction: column;
    }
    
    .search-result-cover-container {
        width: 100px;
        height: 150px;
        align-self: center;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .member-card {
        flex-direction: column;
        text-align: center;
    }
    
    .member-controls {
        justify-content: center;
    }
    
    .invite-form-fields {
        grid-template-columns: 1fr;
    }
    
    .invite-url-section {
        flex-direction: column;
    }
    
    /* Landing page responsive */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-icon {
        font-size: 6rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta,
    .hero-cta-secondary {
        width: 100%;
        text-align: center;
        max-width: 300px;
    }
    
    /* Extra small screen bookshelf card adjustments */
    .bookshelf-card-content {
        padding: 1rem;
        min-height: 100px;
    }
    
    .bookshelf-card-content h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .bookshelf-card-content p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin: 0.5rem 0;
    }
    
    .shelf-badges {
        margin: 0.5rem 0;
        gap: 0.25rem;
    }
    
    .privacy-badge,
    .contribution-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ===== SELF-JOIN COMPONENT STYLES ===== */

/* Self-join container */
.self-join-container {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 100%);
    border: 2px solid #28a745;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
    transition: all 0.3s ease;
}

.self-join-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
}

/* Self-join button */
.self-join-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: var(--brand-white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    text-decoration: none;
    min-height: 48px;
}

.self-join-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.4);
    color: var(--brand-white);
}

.self-join-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Self-join subtitle */
.self-join-subtitle {
    color: #155724;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

/* Success state */
.self-join-success-container {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e8 100%);
    border: 2px solid #28a745;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.self-join-success-message {
    color: #155724;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.self-join-success-subtitle {
    color: #155724;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

/* Form label for self-join checkbox in create/edit forms */
.self-join-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    margin: 1rem 0;
    transition: all 0.2s ease;
}

.self-join-label:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--brand-amber);
}

.self-join-help-text {
    color: var(--brand-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
    font-style: italic;
}

/* Mobile responsive for self-join components */
@media (max-width: 768px) {
    .self-join-container,
    .self-join-success-container {
        margin: 1rem -1rem;
        border-radius: 0;
        padding: 1.25rem;
    }
    
    .self-join-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .self-join-subtitle,
    .self-join-success-subtitle {
        font-size: 0.9rem;
    }
    
    .self-join-success-message {
        font-size: 1rem;
    }
    
    .self-join-label {
        padding: 0.875rem;
        margin: 0.75rem 0;
    }
    
    .self-join-help-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .self-join-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .self-join-subtitle,
    .self-join-success-subtitle {
        font-size: 0.85rem;
    }
    
    .self-join-success-message {
        font-size: 0.95rem;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ===== UTILITY CLASSES ===== */

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Container utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Override PicoCSS for landing page */
.landing-footer hr {
    border-color: #555;
}

/* Ensure proper spacing between sections */
section + section {
    margin-top: 0;
}

/* ===== NETWORK ACTIVITY FEED STYLES ===== */

.network-feed-section {
    background: var(--brand-white);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--brand-border);
}

.network-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.activity-card {
    background: var(--brand-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--brand-border);
    transition: box-shadow 0.2s ease;
}

.activity-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.activity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.activity-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.activity-user-info h4,
.activity-user-info strong {
    margin: 0;
    font-size: 1rem;
    color: var(--brand-text);
}

.activity-handle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--brand-muted);
}

.activity-content {
    margin-left: 4rem;
}

.activity-action {
    margin: 0 0 1rem 0;
    color: var(--brand-muted);
    font-size: 0.95rem;
}

.activity-bookshelf-ref {
    font-weight: 600;
    color: var(--brand-navy);
}

/* Bookshelf Activity Cards */
.activity-bookshelf-card {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.activity-bookshelf-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--brand-navy);
}

.activity-privacy {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--brand-muted);
}

/* Book Activity Cards */
.activity-book-card {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    gap: 1rem;
}

.activity-book-cover {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.activity-book-cover-placeholder {
    width: 60px;
    height: 90px;
    background: var(--brand-muted);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.activity-book-info {
    flex: 1;
}

.activity-book-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--brand-navy);
    line-height: 1.3;
}

.activity-book-author {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--brand-muted);
}

.activity-link {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.activity-link:hover {
    text-decoration: underline;
}

.activity-timestamp {
    margin: 1rem 0 0 4rem;
    font-size: 0.85rem;
    color: var(--brand-muted);
}

/* Empty Network State */
.empty-network-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--brand-light);
    border-radius: 0.75rem;
    border: 2px dashed var(--brand-border);
}

.empty-network-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--brand-navy);
}

.empty-network-description {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--brand-text);
}

.empty-network-suggestion {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: var(--brand-muted);
}

.empty-network-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design for Activity Feed */
@media (max-width: 768px) {
    .network-feed-section {
        padding: 1.5rem;
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .activity-content {
        margin-left: 0;
    }
    
    .activity-timestamp {
        margin-left: 0;
    }
    
    .activity-book-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .activity-book-cover,
    .activity-book-cover-placeholder {
        width: 80px;
        height: 120px;
    }
    
    .empty-network-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .empty-network-actions a {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
}

/* ===== EXPLORE PAGE STYLES ===== */

.explore-hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    border: 1px solid var(--brand-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.explore-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--brand-navy);
    font-family: var(--font-heading);
    font-weight: 700;
}

.explore-subtitle {
    font-size: 1.2rem;
    color: var(--brand-muted);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Enhanced Explore Search Form */
.explore-search-form {
    background: var(--brand-white);
    border: 2px solid var(--brand-border);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.explore-search-form:hover {
    border-color: var(--brand-amber);
    box-shadow: 0 6px 20px rgba(212, 148, 30, 0.15);
}

.explore-search-row {
    display: grid;
    grid-template-columns: 2fr auto auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.explore-search-input {
    padding: 1rem 1.25rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 1.1rem;
    background: var(--brand-white);
    transition: all 0.2s ease;
    min-height: 48px;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

.explore-search-input:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.15);
    transform: translateY(-1px);
}

.explore-sort-select,
.explore-filter-select {
    padding: 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: var(--brand-white);
    transition: all 0.2s ease;
    min-height: 48px;
    min-width: 140px;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

.explore-sort-select:focus,
.explore-filter-select:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.15);
}

.explore-search-btn {
    background: linear-gradient(135deg, var(--brand-amber) 0%, #e6a429 100%);
    color: var(--brand-navy);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(212, 148, 30, 0.25);
    font-family: var(--font-primary);
}

.explore-search-btn:hover {
    background: linear-gradient(135deg, #c08419 0%, #d49520 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.35);
}

.advanced-search-toggle {
    display: inline-block;
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

.advanced-search-toggle:hover {
    color: var(--brand-navy);
    background: var(--brand-light);
    text-decoration: underline;
}

.advanced-search-container {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.advanced-search-fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.advanced-search-fieldset label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--brand-text);
    font-size: 0.95rem;
}

.advanced-search-fieldset input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--brand-white);
    transition: all 0.2s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.advanced-search-fieldset input:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.15);
}

.public-shelves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.shelf-preview-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shelf-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.shelf-preview-covers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    height: 200px;
    margin-bottom: 1rem;
    background: var(--brand-light);
    border-radius: 0.5rem;
    overflow: hidden;
}

.shelf-preview-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shelf-preview-placeholder {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--brand-muted);
}

.shelf-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shelf-footer-left {
    vertical-align: middle;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

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

.owner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.owner-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.book-count {
    font-size: 0.9rem;
    color: var(--brand-muted);
}

/* ===== COMMUNITY READING SECTION ===== */

.community-reading-section {
    padding: 4rem 0;
    background: var(--brand-white);
}

.scroll-wrapper {
    position: relative;
}

.book-scroll-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.book-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}

.scroll-wrapper::before,
.scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    z-index: 2;
}

.scroll-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--brand-white), transparent);
}

.scroll-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--brand-white), transparent);
}

.book-scroll-card {
    flex: 0 0 220px;
    text-decoration: none;
    color: inherit;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--brand-light);
}

.book-scroll-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.book-scroll-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.book-scroll-cover-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--brand-muted);
    background: var(--brand-border);
}

.book-scroll-info {
    padding: 1rem;
}

.book-scroll-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-scroll-shelf {
    font-size: 0.9rem;
    color: var(--brand-muted);
    margin: 0;
}

/* ===== SEARCH PAGE STYLES ===== */

.search-form {
    margin-bottom: 2rem;
    background: var(--brand-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.search-type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.search-type-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--brand-border);
    border-radius: 0.25rem;
    background: var(--brand-white);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.search-type-tab:hover {
    background: var(--brand-light);
    border-color: var(--brand-amber);
}

.search-type-tab input[type="radio"] {
    margin: 0;
}

.search-type-tab input[type="radio"]:checked + span,
.search-type-tab:has(input[type="radio"]:checked) {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border-color: var(--brand-amber);
}

.search-form-grid {
    display: grid;
    grid-template-columns: 2fr auto auto auto auto;
    gap: 1rem;
    align-items: center;
}

.search-form-grid input[type="search"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--brand-white);
    transition: border-color 0.2s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.search-form-grid input[type="search"]:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.1);
}

.search-form-grid select {
    padding: 0.75rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: var(--brand-white);
    transition: border-color 0.2s ease;
    min-height: 44px;
    min-width: 120px;
    box-sizing: border-box;
}

.search-form-grid select:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.1);
}

.search-form-grid button[type="submit"] {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(212, 148, 30, 0.2);
}

.search-form-grid button[type="submit"]:hover {
    background: #c08419;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(212, 148, 30, 0.3);
}

.advanced-search-toggle {
    display: block;
    margin-top: 1rem;
    text-align: right;
    color: var(--brand-amber);
    cursor: pointer;
}

#search-results-grid {
    margin-top: 2rem;
}

/* Search Results Sections */
.search-section {
    margin-bottom: 3rem;
}

.search-section-title {
    color: var(--brand-navy);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.search-shelves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.search-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* User Search Result Cards */
.user-search-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-search-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-search-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-search-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-border);
}

.user-search-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid var(--brand-border);
}

.user-search-info {
    flex: 1;
}

.user-search-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 0.25rem;
}

.user-search-handle {
    color: var(--brand-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.user-search-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-search-stat {
    font-size: 0.8rem;
    color: var(--brand-text);
    background: var(--brand-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.user-search-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--brand-border);
}

.user-search-recent {
    font-size: 0.85rem;
    color: var(--brand-muted);
    margin: 0;
}

.user-search-link {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.user-search-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    /* Enhanced Explore Page Mobile Styles */
    .explore-hero {
        padding: 2rem 0;
        margin: 0 -1rem 2rem -1rem;
        border-radius: 0;
    }
    
    .explore-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .explore-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .explore-search-form {
        margin: 0 -1rem 2rem -1rem;
        border-radius: 0;
        padding: 1.5rem;
        border-left: none;
        border-right: none;
    }
    
    .explore-search-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .explore-search-input {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
    }
    
    .explore-sort-select,
    .explore-filter-select {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
        min-width: 100%;
        width: 100%;
    }
    
    .explore-search-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
        justify-content: center;
    }
    
    .advanced-search-toggle {
        text-align: center;
        margin-top: 1rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .advanced-search-container {
        padding: 1.25rem;
        margin-top: 1rem;
    }
    
    .advanced-search-fieldset {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .advanced-search-fieldset input {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .public-shelves-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Original search page mobile styles */
    .search-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-form-grid input[type="search"] {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .search-form-grid select {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
        min-width: 100%;
    }
    
    .search-form-grid button[type="submit"] {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
    }
    
    .search-type-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .search-type-tab {
        flex: 1;
        min-width: 100px;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .search-shelves-grid,
    .search-users-grid {
        grid-template-columns: 1fr;
    }
    
    .user-search-content {
        flex-direction: column;
        text-align: center;
    }
    
    .user-search-stats {
        justify-content: center;
    }
    
    .user-search-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Enhanced mobile styles for very small screens */
@media (max-width: 480px) {
    .explore-hero {
        padding: 1.5rem 0;
    }
    
    .explore-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .explore-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .explore-search-form {
        padding: 1.25rem;
    }
    
    .explore-search-input {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    .explore-sort-select,
    .explore-filter-select {
        padding: 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    .explore-search-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .advanced-search-toggle {
        font-size: 0.85rem;
        padding: 0.6rem;
    }
    
    .advanced-search-container {
        padding: 1rem;
    }
    
    .advanced-search-fieldset input {
        padding: 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    .public-shelves-grid {
        gap: 1rem;
    }
}

/* ===== VIEW TOGGLE STYLES ===== */

.view-toggle-btn {
    font-size: 1.1rem;
}

/* Button visibility based on view state */
.grid-view .grid-toggle-btn {
    display: none;
}

.list-view .list-toggle-btn {
    display: none;
}

/* Default state (grid view) */
.books-section:not(.list-view) .grid-toggle-btn {
    display: none;
}

.books-section:not(.list-view) .list-toggle-btn {
    display: flex;
}

/* ===== LIST VIEW TABLE STYLES ===== */

.book-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--brand-white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--brand-border);
}

.book-table-header th {
    background: var(--brand-light);
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--brand-text);
    border-bottom: 2px solid var(--brand-border);
    font-size: 0.9rem;
}

.book-table-row {
    border-bottom: 1px solid var(--brand-border);
    transition: background-color 0.2s ease;
}

.book-table-row:hover {
    background: var(--brand-light);
}

.book-table-row:last-child {
    border-bottom: none;
}

.book-table-row td {
    padding: 1rem 0.75rem;
    vertical-align: top;
}

/* Table Cell Styles */
.cover-cell {
    width: 60px;
    text-align: center;
}

.book-table-cover {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.book-table-cover-placeholder {
    width: 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-border);
    color: var(--brand-muted);
    border-radius: 0.25rem;
    font-size: 1.5rem;
}

.title-cell {
    min-width: 200px;
}

.book-table-title {
    font-size: 1rem;
    color: var(--brand-text);
    line-height: 1.3;
}

.author-cell {
    min-width: 150px;
    color: var(--brand-muted);
    font-size: 0.9rem;
}

.description-cell {
    max-width: 300px;
    color: var(--brand-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.votes-cell {
    width: 120px;
    text-align: center;
}

.table-voting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.table-voting-buttons {
    display: flex;
    gap: 0.25rem;
}

.vote-btn-small {
    background: none;
    border: 1px solid var(--brand-border);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.vote-btn-small:hover:not(:disabled) {
    background: var(--brand-light);
    border-color: var(--brand-amber);
}

.vote-btn-small.voted {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border-color: var(--brand-amber);
}

.vote-btn-small.disabled,
.vote-btn-small:disabled {
    background: var(--brand-light);
    color: var(--brand-muted);
    border-color: var(--brand-border);
    cursor: not-allowed;
    opacity: 0.6;
}

.table-vote-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-text);
    min-width: 20px;
}

.actions-cell {
    width: 120px;
    text-align: center;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.table-more-info-link {
    font-size: 0.8rem;
    color: var(--brand-amber);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.table-more-info-link:hover {
    background: var(--brand-light);
    color: var(--brand-navy);
    text-decoration: underline;
}

.table-remove-btn {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.table-remove-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* Mobile Responsive for Table */
@media (max-width: 768px) {
    .book-table {
        font-size: 0.85rem;
    }
    
    .book-table-header th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .book-table-row td {
        padding: 0.75rem 0.5rem;
    }
    
    .description-cell {
        display: none; /* Hide description on mobile */
    }
    
    .cover-header:nth-child(4),
    .book-table-header th:nth-child(4) {
        display: none; /* Hide description header on mobile */
    }
    
    .vote-btn-small {
        min-width: 32px;
        min-height: 32px;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .author-cell {
        display: none; /* Hide author on very small screens */
    }
    
    .book-table-header th:nth-child(3) {
        display: none; /* Hide author header on very small screens */
    }
    
    .title-cell {
        min-width: 120px;
    }
}

/* ===== LOGIN PAGE STYLES ===== */

.login-container {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
}

.login-card {
    background: var(--brand-white);
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--brand-border);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.login-subtitle {
    color: var(--brand-muted);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.login-form {
    margin-bottom: 2rem;
}

.login-fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.login-fieldset label {
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 0.5rem;
    display: block;
}

.login-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: var(--brand-white);
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.1);
}

.login-btn-primary {
    width: 100%;
    background: var(--brand-amber);
    color: var(--brand-navy);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.login-btn-primary:hover {
    background: #c08419;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 148, 30, 0.3);
}

.login-help {
    border-top: 1px solid var(--brand-border);
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--brand-muted);
}

.login-help p {
    margin: 0.5rem 0;
}

.login-help-link {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 500;
}

.login-help-link:hover {
    text-decoration: underline;
    color: var(--brand-navy);
}

/* Mobile responsive for login */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
        min-height: calc(100vh - 100px);
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 0.75rem;
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
    }
    
    .login-logo {
        width: 60px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-input {
        padding: 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .login-btn-primary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* ===== UNIVERSAL FOOTER STYLES ===== */

.universal-footer {
    background: #333;
    color: white;
    padding: 0.75rem 0;
    margin-top: auto;
    border-top: 1px solid var(--brand-border);
}

.universal-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 60px;
}

.footer-left {
    flex: 1;
    text-align: center;
}

.footer-text {
    color: #ccc;
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-text a {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 600;
}

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

.footer-copyright {
    color: #999;
    font-size: 0.8rem;
    margin: 0;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.social-icon {
    color: var(--brand-amber);
    font-size: 1.4rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    border-radius: 0.25rem;
}

.social-icon:hover {
    color: var(--brand-white);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.contact-btn {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 44px;
    box-shadow: 0 2px 4px rgba(212, 148, 30, 0.2);
}

.contact-btn:hover {
    background: #c08419;
    color: var(--brand-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(212, 148, 30, 0.3);
}

/* ===== CONTACT MODAL STYLES ===== */

/* Modal overlay */
.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

/* Modal dialog container */
.contact-modal-dialog {
    background: var(--brand-white);
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--brand-border);
    animation: slideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

/* Modal header */
.contact-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 1px solid var(--brand-border);
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
    flex-shrink: 0;
}

.contact-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-modal-close {
    background: var(--brand-white);
    border: 2px solid var(--brand-border);
    color: var(--brand-muted);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-modal-close:hover {
    background: #fee;
    border-color: #dc3545;
    color: #dc3545;
    transform: scale(1.05);
}

/* Modal body */
.contact-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 200px); /* Reserve space for header and footer */
}

/* Modal footer */
.contact-modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--brand-border);
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
    flex-shrink: 0;
}

/* Contact form styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-form-label {
    font-weight: 600;
    color: var(--brand-text);
    font-size: 0.95rem;
}

.contact-form-input,
.contact-form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: var(--brand-white);
    box-sizing: border-box;
    font-family: var(--font-primary);
}

.contact-form-input:focus,
.contact-form-textarea:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 3px rgba(212, 148, 30, 0.1);
}

.contact-form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.contact-form-submit {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(212, 148, 30, 0.2);
}

.contact-form-submit:hover {
    background: #c08419;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(212, 148, 30, 0.3);
}

.contact-form-submit:disabled {
    background: var(--brand-light);
    color: var(--brand-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Contact form success/error states */
.contact-success-message {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e8 100%);
    border: 2px solid #28a745;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    color: #155724;
    animation: slideIn 0.4s ease-out;
}

.contact-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #155724;
}

.contact-success-text {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.5;
}

.contact-error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    color: #721c24;
    animation: slideIn 0.4s ease-out;
}

.contact-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #721c24;
}

.contact-error-text {
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.5;
}

/* Loading state for contact form */
.contact-form.htmx-request .contact-form-submit {
    position: relative;
    pointer-events: none;
}

.contact-form.htmx-request .contact-form-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile responsive for contact modal */
@media (max-width: 768px) {
    .contact-modal-overlay {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .contact-modal-dialog {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 0.75rem;
    }
    
    .contact-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .contact-modal-title {
        font-size: 1.5rem;
    }
    
    .contact-modal-close {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
    }
    
    .contact-modal-body {
        padding: 1.5rem;
    }
    
    .contact-form-input,
    .contact-form-textarea {
        padding: 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .contact-form-submit {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .contact-success-title,
    .contact-error-title {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .contact-success-text,
    .contact-error-text {
        font-size: 1rem;
    }
    
    /* Footer mobile adjustments */
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        min-height: auto;
    }
    
    .footer-left {
        text-align: center;
    }
    
    .footer-right {
        gap: 0.75rem;
    }
    
    .social-icon {
        font-size: 1.25rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .contact-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .contact-modal-overlay {
        padding: 0.5rem;
        padding-top: 1rem;
    }
    
    .contact-modal-dialog {
        max-height: 98vh;
        border-radius: 0.5rem;
    }
    
    .contact-modal-header {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .contact-modal-title {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .contact-modal-close {
        min-width: 36px;
        min-height: 36px;
        padding: 0.4rem;
        font-size: 1rem;
    }
    
    .contact-modal-body {
        padding: 1rem;
    }
    
    .contact-form-group {
        gap: 0.4rem;
    }
    
    .contact-form-label {
        font-size: 0.9rem;
    }
    
    .contact-form-input,
    .contact-form-textarea {
        padding: 0.75rem;
        font-size: 16px;
    }
    
    .contact-form-textarea {
        min-height: 100px;
    }
    
    .contact-form-submit {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .contact-success-message,
    .contact-error-message {
        padding: 1.5rem;
    }
    
    .contact-success-title,
    .contact-error-title {
        font-size: 1.1rem;
    }
    
    .contact-success-text,
    .contact-error-text {
        font-size: 0.95rem;
    }
    
    /* Footer mobile adjustments */
    .universal-footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    .footer-text {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-social {
        gap: 0.5rem;
        margin: 0.75rem 0;
    }
    
    .social-icon {
        font-size: 1.25rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .contact-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
        min-height: 36px;
        gap: 0.375rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
    }
}

/* ===== USER PROFILE PAGE STYLES ===== */

.profile-header-card {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 0.5rem;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-border);
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 3px solid var(--brand-border);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.profile-handle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-handle {
    font-size: 1.2rem;
    color: var(--brand-muted);
    margin: 0;
}

.profile-bluesky-link {
    color: #4a90a4;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.profile-bluesky-link:hover {
    color: var(--brand-amber);
    background: var(--brand-light);
    transform: scale(1.1);
}

.profile-bluesky-link i {
    font-size: 1.2rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-stat {
    font-size: 0.9rem;
    color: var(--brand-text);
    background: var(--brand-white);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--brand-border);
}

/* User Shelves Section */
.user-shelves-section {
    margin-bottom: 3rem;
}

.user-shelves-section h3 {
    color: var(--brand-navy);
    margin-bottom: 1.5rem;
}

.user-shelves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* User Activity Section */
.user-activity-section {
    margin-bottom: 3rem;
}

.user-activity-section h3 {
    color: var(--brand-navy);
    margin-bottom: 1.5rem;
}

.user-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-activity-card {
    background: var(--brand-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--brand-border);
    transition: box-shadow 0.2s ease;
}

.user-activity-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-activity-content {
    margin-bottom: 1rem;
}

.user-activity-action {
    margin: 0 0 1rem 0;
    color: var(--brand-muted);
    font-size: 0.95rem;
}

.user-activity-timestamp {
    font-size: 0.85rem;
    color: var(--brand-muted);
    margin: 0;
}

/* Activity User Link */
.activity-user-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.activity-user-link:hover {
    color: var(--brand-amber);
}

/* ===== USER ATTRIBUTION STYLES ===== */

/* Book Card User Attribution - Enhanced visibility */
.book-added-by {
    font-size: 0.7rem;
    color: var(--brand-muted);
    margin-top: 0.5rem;
    text-align: center;
}

.book-added-by-link {
    color: #4a90a4; /* Subtle blue-tinted color to suggest linkability */
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
}

.book-added-by-link:hover {
    color: var(--brand-amber);
    text-decoration: underline;
    transform: scale(1.02);
}

/* Table view user attribution */
.book-added-by-table {
    font-size: 0.75rem;
    color: var(--brand-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Member Card User Links - Enhanced visibility while maintaining design */
.member-name-link {
    color: #4a90a4; /* Subtle blue-tinted color to suggest linkability */
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.member-name-link:hover {
    color: var(--brand-amber);
    text-decoration: underline;
    transform: scale(1.02);
}

.member-handle-link {
    color: #5a9bb0; /* Slightly lighter blue for handles */
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.member-handle-link:hover {
    color: var(--brand-amber);
    text-decoration: underline;
    transform: scale(1.02);
}

/* Activity Feed User Links - Enhanced visibility */
.activity-user-link {
    color: #4a90a4; /* Consistent blue-tinted color */
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.activity-user-link:hover {
    color: var(--brand-amber);
    text-decoration: underline;
    transform: scale(1.02);
}

/* ===== NETWORK ACTIVITY PREVIEW STYLES ===== */

/* Main preview container */
.network-preview-card {
    background: var(--brand-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--brand-border);
    margin-bottom: 2rem;
}

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

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-navy);
    margin: 0;
    font-family: var(--font-heading);
}

.preview-view-all {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.preview-view-all:hover {
    color: var(--brand-navy);
    background: var(--brand-light);
    text-decoration: none;
    transform: translateX(2px);
}

/* Activity list container */
.preview-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Compact activity cards */
.compact-activity-card {
    background: var(--brand-light);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--brand-border);
    transition: all 0.2s ease;
    position: relative;
}

.compact-activity-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.compact-activity-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.compact-activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--brand-border);
}

.compact-activity-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid var(--brand-border);
    color: var(--brand-white);
}

.compact-activity-content {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.compact-activity-user {
    font-weight: 600;
    color: var(--brand-text);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.compact-activity-action {
    color: var(--brand-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.compact-activity-link {
    color: var(--brand-amber);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.compact-activity-link:hover {
    color: var(--brand-navy);
    text-decoration: underline;
}

.compact-activity-book-title {
    font-weight: 600;
    color: var(--brand-navy);
}

.compact-activity-time {
    font-size: 0.75rem;
    color: var(--brand-muted);
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--brand-white);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--brand-border);
}

/* Empty state for preview */
.preview-empty-content {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--brand-light);
    border-radius: 0.5rem;
    border: 2px dashed var(--brand-border);
}

.preview-empty-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--brand-navy);
}

.preview-empty-suggestion {
    font-size: 0.9rem;
    color: var(--brand-muted);
    margin: 0;
}

/* Mobile responsive for network preview */
@media (max-width: 768px) {
    .network-preview-card {
        padding: 1rem;
        margin: 0 -1rem 2rem -1rem;
        border-radius: 0;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .preview-view-all {
        align-self: flex-end;
        font-size: 0.85rem;
    }
    
    .compact-activity-time {
        position: static;
        margin-top: 0.5rem;
        align-self: flex-start;
        font-size: 0.7rem;
    }
    
    .compact-activity-main {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .compact-activity-avatar,
    .compact-activity-avatar-placeholder {
        width: 32px;
        height: 32px;
        align-self: flex-start;
    }
    
    .preview-empty-content {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .preview-title {
        font-size: 1.1rem;
    }
    
    .compact-activity-card {
        padding: 0.75rem;
    }
    
    .compact-activity-user {
        font-size: 0.85rem;
    }
    
    .compact-activity-action {
        font-size: 0.8rem;
    }
    
    .preview-view-all {
        font-size: 0.8rem;
    }
}

/* ===== BACKGROUND LOADING STYLES ===== */

/* Loading container for network activity */
.preview-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--brand-light);
    border-radius: 0.5rem;
    border: 2px dashed var(--brand-border);
    min-height: 120px;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Enhanced loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--brand-border);
    border-top: 3px solid var(--brand-amber);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--brand-amber);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

.loading-text {
    font-size: 1rem;
    color: var(--brand-navy);
    font-weight: 500;
    margin: 0;
    text-align: center;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Error state styles */
.preview-error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #fff3cd;
    border-radius: 0.5rem;
    border: 2px solid #ffc107;
    min-height: 120px;
    text-align: center;
}

.error-text {
    font-size: 1rem;
    color: #856404;
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.retry-btn {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.retry-btn:hover {
    background: #c08419;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(212, 148, 30, 0.3);
}

.retry-btn.secondary {
    background: var(--brand-white);
    color: var(--brand-amber);
    border: 2px solid var(--brand-amber);
}

.retry-btn.secondary:hover {
    background: var(--brand-amber);
    color: var(--brand-navy);
}

/* Loading states for HTMX requests */
.htmx-request .loading-spinner {
    animation-duration: 0.8s;
}

.htmx-request .loading-text {
    animation-duration: 1.5s;
}

/* Mobile responsive for loading states */
@media (max-width: 768px) {
    .preview-loading-container,
    .preview-error-content {
        padding: 1.5rem 1rem;
        min-height: 100px;
    }
    
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    .loading-spinner::after {
        width: 6px;
        height: 6px;
    }
    
    .loading-text {
        font-size: 0.9rem;
    }
    
    .error-text {
        font-size: 0.9rem;
    }
    
    .retry-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .loading-spinner {
        width: 28px;
        height: 28px;
    }
    
    .loading-text {
        font-size: 0.85rem;
    }
    
    .error-text {
        font-size: 0.85rem;
    }
    
    .retry-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ===== SHARE MODAL STYLES ===== */

/* Modal overlay */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal dialog container */
.share-modal-dialog {
    background: var(--brand-white);
    border-radius: 1rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--brand-border);
    animation: slideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal header */
.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 1px solid var(--brand-border);
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
    flex-shrink: 0;
}

.share-modal-title-section {
    flex: 1;
    margin-right: 2rem;
}

.share-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 0.5rem 0;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.2;
}

.share-modal-privacy {
    font-size: 1rem;
    color: var(--brand-muted);
    margin: 0;
    font-weight: 500;
}

.share-modal-close {
    background: var(--brand-white);
    border: 2px solid var(--brand-border);
    color: var(--brand-muted);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-right: 2%;
}

.share-modal-close:hover {
    background: #fee;
    border-color: #dc3545;
    color: #dc3545;
    transform: scale(1.05);
}

/* Modal body */
.share-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Share options section */
.share-options-section {
    flex-shrink: 0;
}

.share-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-navy);
    margin: 0 0 0.75rem 0;
    font-family: var(--font-heading);
}

.share-section-subtitle {
    font-size: 1rem;
    color: var(--brand-muted);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.share-options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-type-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--brand-white);
    position: relative;
}

.share-type-option:hover {
    border-color: var(--brand-amber);
    background: linear-gradient(135deg, #fff8e1 0%, var(--brand-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.15);
}

.share-type-option:has(input:checked) {
    border-color: var(--brand-amber);
    background: linear-gradient(135deg, #fff8e1 0%, var(--brand-light) 100%);
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.25);
}

.share-type-option input[type="radio"] {
    margin: 0;
    margin-top: 0.25rem;
    transform: scale(1.2);
    accent-color: var(--brand-amber);
}

.share-option-content {
    flex: 1;
}

.share-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.share-option-header strong {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-text);
}

.share-option-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.share-option-description {
    font-size: 0.95rem;
    color: var(--brand-muted);
    margin: 0;
    line-height: 1.5;
}

/* Preview section */
.share-preview-section {
    flex: 1;
    min-height: auto;
}

.share-preview-container {
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.share-preview-placeholder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--brand-muted);
    background: var(--brand-light);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 2px dashed var(--brand-border);
    text-align: center;
    font-style: italic;
}

.share-preview-placeholder i {
    font-size: 1.25rem;
    color: var(--brand-amber);
}

/* Enhanced Share Preview Styles */
.share-preview-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--brand-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.share-preview-card.enhanced {
    border-color: var(--brand-amber);
    box-shadow: 0 6px 20px rgba(212, 148, 30, 0.15);
}

/* Enhanced header section */
.share-preview-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--brand-border);
}

.share-preview-title-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.share-preview-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0;
    font-family: var(--font-heading);
}

.share-preview-description {
    font-size: 0.95rem;
    color: var(--brand-text);
    margin: 0;
    line-height: 1.5;
    background: var(--brand-white);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--brand-border);
    font-weight: 500;
}

/* Enhanced message section */
.share-preview-content {
    margin-bottom: 1.5rem;
}

.share-preview-label-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.share-preview-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-navy);
    margin: 0;
}

/* Message card styling */
.share-preview-message-card {
    background: var(--brand-white);
    border: 2px solid var(--brand-amber);
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}

.share-preview-message-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 148, 30, 0.3);
    border-color: #c08419;
}

.share-preview-message-content {
    padding: 1.25rem;
}

.message-type-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--brand-border);
}

.message-type-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-amber) 0%, #e6a429 100%);
    border-radius: 50%;
    color: var(--brand-navy);
    font-weight: bold;
}

.message-type-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-preview-message-text {
    font-size: 0.95rem;
    color: var(--brand-text);
    line-height: 1.6;
    margin: 0 0 1rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    border: 1px solid var(--brand-border);
    font-family: var(--font-primary);
    word-break: break-word;
    cursor: text;
    user-select: all;
    transition: all 0.2s ease;
}

.share-preview-message-text:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--brand-amber);
}

.message-copy-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--brand-muted);
    background: var(--brand-light);
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--brand-border);
    font-style: italic;
    transition: all 0.2s ease;
}

.share-preview-message-card:hover .message-copy-hint {
    color: var(--brand-amber);
    background: #fff8e1;
    border-color: var(--brand-amber);
}

/* Enhanced generate button */
.generate-link-btn.enhanced-primary {
    background: linear-gradient(135deg, var(--brand-amber) 0%, #e6a429 100%);
    color: var(--brand-navy);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.3);
    text-transform: none;
    letter-spacing: 0.3px;
}

.generate-link-btn.enhanced-primary:hover {
    background: linear-gradient(135deg, #c08419 0%, #d49520 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 148, 30, 0.4);
}

.generate-link-btn.enhanced-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.3);
}

.generate-link-btn.enhanced-primary:disabled {
    background: var(--brand-light);
    color: var(--brand-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Share preview section */
.share-preview-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--brand-light);
    border-radius: 0.5rem;
    border: 1px solid var(--brand-border);
}

.share-preview-privacy-note {
    font-size: 0.85rem;
    color: var(--brand-muted);
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--brand-white);
    border-radius: 0.25rem;
    border: 1px solid var(--brand-border);
    font-style: italic;
}

/* Share button in shelf header */
.share-btn {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    color: var(--brand-text);
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.share-btn:hover {
    background: var(--brand-amber);
    color: var(--brand-navy);
    border-color: var(--brand-amber);
}

/* Mobile responsive for share modal */
@media (max-width: 768px) {
    .share-modal-overlay {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .share-modal-dialog {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 0.75rem;
    }
    
    .share-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .share-modal-title-section {
        margin-right: 0;
        width: 100%;
    }
    
    .share-modal-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .share-modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
    }
    
    .share-modal-body {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .share-section-title {
        font-size: 1.1rem;
    }
    
    .share-section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .share-options-grid {
        gap: 0.75rem;
    }
    
    .share-type-option {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .share-option-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .share-option-header strong {
        font-size: 1rem;
    }
    
    .share-option-icon {
        font-size: 1.25rem;
        align-self: flex-end;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .share-option-description {
        font-size: 0.9rem;
    }
    
    .share-preview-placeholder {
        padding: 1.5rem;
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Enhanced share preview mobile styles */
    .share-preview-card.enhanced {
        padding: 1.25rem;
        margin: 0;
    }
    
    .share-preview-title-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .share-preview-title {
        font-size: 1.1rem;
    }
    
    .share-preview-description {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .share-preview-label-container {
        margin-bottom: 1rem;
    }
    
    .share-preview-label {
        font-size: 0.95rem;
    }
    
    .message-type-header {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .message-type-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    .message-type-label {
        font-size: 0.85rem;
    }
    
    .share-preview-message-text {
        font-size: 0.9rem;
        padding: 1rem;
        line-height: 1.6;
    }
    
    .message-copy-hint {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .generate-link-btn.enhanced-primary {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .share-modal-overlay {
        padding: 0.5rem;
        padding-top: 1rem;
    }
    
    .share-modal-dialog {
        max-height: 98vh;
        border-radius: 0.5rem;
    }
    
    .share-modal-header {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .share-modal-title {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .share-modal-close {
        top: 0.75rem;
        right: 0.75rem;
        min-width: 36px;
        min-height: 36px;
        padding: 0.4rem;
        font-size: 1rem;
    }
    
    .share-modal-body {
        padding: 1rem;
        gap: 1.25rem;
    }
    
    .share-section-title {
        font-size: 1rem;
    }
    
    .share-section-subtitle {
        font-size: 0.85rem;
    }
    
    .share-type-option {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .share-option-header strong {
        font-size: 0.95rem;
    }
    
    .share-option-icon {
        font-size: 1.1rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .share-option-description {
        font-size: 0.85rem;
    }
    
    .share-preview-placeholder {
        padding: 1.25rem;
        font-size: 0.85rem;
    }
    
    .share-preview-card.enhanced {
        padding: 1rem;
    }
    
    .share-preview-title {
        font-size: 1rem;
    }
    
    .share-preview-description {
        font-size: 0.85rem;
        padding: 0.6rem;
    }
    
    .share-preview-label {
        font-size: 0.9rem;
    }
    
    .message-type-header {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .message-type-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .message-type-label {
        font-size: 0.8rem;
    }
    
    .share-preview-message-text {
        font-size: 0.85rem;
        padding: 0.875rem;
        line-height: 1.5;
    }
    
    .message-copy-hint {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
    
    .generate-link-btn.enhanced-primary {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Mobile responsive for user profile */
@media (max-width: 768px) {
    .profile-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-avatar,
    .profile-avatar-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 1.75rem;
    }
    
    .profile-handle {
        font-size: 1.1rem;
    }
    
    .profile-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .user-shelves-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-header-card {
        padding: 1.5rem;
    }
    
    .profile-avatar,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-handle {
        font-size: 1rem;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .profile-stat {
        text-align: center;
    }
}

/* ===== CONTACT ICON BUTTON STYLES ===== */

.contact-icon-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.contact-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-2px) !important;
    box-shadow: none !important;
}

/* ===== ENHANCED CONTACT FORM STYLES ===== */

.contact-modal-subtitle {
    color: var(--brand-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.contact-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-input,
.contact-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--brand-border);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--brand-white);
    box-sizing: border-box;
    font-family: var(--font-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contact-input:focus,
.contact-textarea:focus {
    outline: none;
    border-color: var(--brand-amber);
    box-shadow: 0 0 0 4px rgba(212, 148, 30, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.contact-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* Contact form container */
.contact-form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Response area for success/error messages */
#contact-form-response {
    min-height: 0;
    transition: all 0.3s ease;
}

/* Remove old form actions styles since actions are now in modal footer */
.contact-form-actions {
    display: none; /* Hide since actions are now in modal footer */
}

.contact-btn-primary {
    background: linear-gradient(135deg, var(--brand-amber) 0%, #e6a429 100%);
    color: var(--brand-navy);
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(212, 148, 30, 0.3);
    letter-spacing: 0.3px;
}

.contact-btn-primary:hover {
    background: linear-gradient(135deg, #c08419 0%, #d49520 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 148, 30, 0.4);
}

.contact-btn-secondary {
    background: var(--brand-white);
    color: var(--brand-muted);
    border: 2px solid var(--brand-border);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-btn-secondary:hover {
    background: var(--brand-light);
    border-color: var(--brand-amber);
    color: var(--brand-text);
    transform: translateY(-1px);
}

.contact-success-container,
.contact-error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 2rem;
}

.contact-success-content,
.contact-error-content {
    text-align: center;
    max-width: 400px;
}

/* Mobile responsive for enhanced contact form */
@media (max-width: 768px) {
    .contact-modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 180px); /* Adjust for mobile */
    }
    
    .contact-modal-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
        padding: 1.25rem 1.5rem;
    }
    
    .contact-btn-primary,
    .contact-btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .contact-input,
    .contact-textarea {
        padding: 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 0.5rem;
    }
    
    .contact-textarea {
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    .contact-modal-body {
        padding: 1rem;
        max-height: calc(98vh - 160px); /* Adjust for very small screens */
    }
    
    .contact-modal-footer {
        padding: 1rem;
    }
    
    .contact-btn-primary,
    .contact-btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
    }
    
    .contact-input,
    .contact-textarea {
        padding: 0.75rem;
        font-size: 16px;
    }
    
    .contact-textarea {
        min-height: 100px;
    }
}
