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

body {
    font-family: 'Bricolage Grotesque', sans-serif;
    background-color: #f5f5f3;
    min-height: 100vh;
}

.bubble-font {
    font-family: 'Caveat', cursive;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background-color: #f5f5f3;
}

/* Header styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f5f5f3;
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Enhanced mascot bubble */
.mascot-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4edda 0%, #a8d5b8 100%);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.mascot-bubble:hover {
    transform: scale(1.08);
}

.mascot-bubble.celebrating {
    animation: celebrate-bounce 0.5s ease infinite;
}

@keyframes celebrate-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mascot-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.frog-emoji {
    font-size: 28px;
    z-index: 2;
}

.reading-book {
    font-size: 14px;
    position: absolute;
    bottom: -2px;
    right: -8px;
}

.party-hat {
    font-size: 16px;
    position: absolute;
    top: -12px;
    right: -8px;
    animation: party-bounce 0.3s ease infinite alternate;
}

@keyframes party-bounce {
    from { transform: rotate(-10deg); }
    to { transform: rotate(10deg); }
}

.think-bubble {
    font-size: 14px;
    position: absolute;
    top: -8px;
    right: -10px;
    animation: think-float 1s ease infinite;
}

@keyframes think-float {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-3px); opacity: 0.7; }
}

.tear {
    font-size: 12px;
    position: absolute;
    bottom: 2px;
    right: -6px;
    animation: tear-fall 1s ease infinite;
}

@keyframes tear-fall {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(10px); opacity: 0; }
}

.wave-hand {
    font-size: 14px;
    position: absolute;
    top: -6px;
    right: -10px;
    animation: wave 0.5s ease infinite alternate;
}

@keyframes wave {
    from { transform: rotate(-20deg); }
    to { transform: rotate(20deg); }
}

.thumbs {
    font-size: 14px;
    position: absolute;
    top: -8px;
    right: -10px;
    animation: thumbs-pop 0.3s ease;
}

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

.sparkles {
    position: absolute;
    inset: -15px;
    pointer-events: none;
}

.sparkle-star {
    position: absolute;
    font-size: 10px;
    animation: sparkle 0.6s ease forwards;
}

.sparkle-star:nth-child(1) { top: 0; left: 50%; }
.sparkle-star:nth-child(2) { top: 20%; right: 0; }
.sparkle-star:nth-child(3) { bottom: 20%; right: 0; }
.sparkle-star:nth-child(4) { bottom: 0; left: 50%; }
.sparkle-star:nth-child(5) { bottom: 20%; left: 0; }
.sparkle-star:nth-child(6) { top: 20%; left: 0; }

@keyframes sparkle {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Toast notification */
.toast-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 20px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Welcome banner */
.welcome-banner {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.welcome-content {
    background: white;
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 360px;
    text-align: center;
    animation: slideUp 0.4s ease;
}

.welcome-mascot {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-title {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: #7CB342;
    margin-bottom: 20px;
}

.welcome-tips {
    text-align: left;
    margin-bottom: 24px;
}

.tip {
    padding: 8px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.tip:last-child {
    border-bottom: none;
}

.welcome-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    transition: all 0.2s ease;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 179, 66, 0.4);
}

/* Navigation tabs */
.nav-tabs {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}

.nav-tabs-inner {
    display: flex;
    background: white;
    padding: 6px;
    border-radius: 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    gap: 4px;
}

.nav-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 22px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Bricolage Grotesque', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-tab-active {
    background: #1a1a1a;
    color: white;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #E57373;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sub tabs */
.sub-tabs {
    display: flex;
    background: #e8e8e8;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.sub-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Bricolage Grotesque', sans-serif;
}

.sub-tab-active {
    background: white;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Filter chips */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: 'Bricolage Grotesque', sans-serif;
}

.filter-chip:hover {
    border-color: #ccc;
}

.filter-chip-active {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

/* Main content */
.main-content {
    padding-bottom: 100px;
}

.section-container {
    padding: 0 20px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.section-subtitle {
    color: #666;
    margin-bottom: 24px;
    font-size: 15px;
}

.book-count-badge {
    background: #7CB342;
    color: white;
    font-size: 14px;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* Search and filter */
.search-input {
    padding: 14px 18px;
    border: none;
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    font-size: 15px;
    font-family: 'Bricolage Grotesque', sans-serif;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

/* Books grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Book card */
.book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.book-cover-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background: #f0f0f0;
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.condition-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-olive-600 {
    background-color: #5c6e58;
}

.owner-avatar {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
}

.wishlist-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0.8);
}

.book-card:hover .wishlist-btn {
    opacity: 1;
    transform: scale(1);
}

.wishlist-btn.wishlisted {
    opacity: 1;
    transform: scale(1);
    animation: heart-pop 0.3s ease;
}

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

.book-title {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Add book button and form */
.add-book-btn {
    padding: 10px 20px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    transition: all 0.2s ease;
}

.add-book-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.add-book-form {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.isbn-row {
    display: flex;
    gap: 8px;
}

.isbn-fetch-btn {
    padding: 12px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.isbn-fetch-btn:hover:not(:disabled) {
    background: #e5e5e5;
}

.isbn-fetch-btn:disabled {
    opacity: 0.5;
}

.form-input {
    padding: 14px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Bricolage Grotesque', sans-serif;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #7CB342;
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
}

.message-input {
    resize: none;
    min-height: 60px;
}

/* Buttons */
.btn-primary {
    padding: 14px 24px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #333;
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 14px 24px;
    background: #f0f0f0;
    color: #1a1a1a;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e5e5;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    color: #E57373;
    border: 1px solid #E57373;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Bricolage Grotesque', sans-serif;
    transition: all 0.2s ease;
    font-size: 13px;
}

.btn-cancel:hover {
    background: #fef2f2;
}

/* Remove book button */
.remove-book-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.book-card:hover .remove-book-btn,
div:hover > .remove-book-btn {
    opacity: 1;
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-mascot {
    font-size: 48px;
    margin-bottom: 8px;
}

.empty-mascot-large {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dust-bunnies {
    font-size: 24px;
    animation: float 2s ease infinite;
}

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

.empty-state-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    color: #888;
    font-size: 14px;
}

/* Status badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-proposed {
    background: #FFF3E0;
    color: #F5A623;
}

.status-accepted {
    background: #E8F5E9;
    color: #7CB342;
}

.status-declined {
    background: #FFEBEE;
    color: #E57373;
}

.status-default {
    background: #f5f5f5;
    color: #888;
}

/* Trade card */
.trade-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.small-book-cover {
    width: 80px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    position: relative;
}

.trade-label {
    font-size: 10px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 10px;
    color: #666;
    font-weight: 600;
}

.swap-arrow {
    font-size: 24px;
    color: #ccc;
    animation: swap-pulse 2s ease infinite;
}

@keyframes swap-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.trade-message {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 12px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: #f5f5f3;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.wanted-book-display {
    background: white;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
}

.owner-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.divider-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.swap-icon-large {
    font-size: 32px;
    animation: rotate-swap 2s ease infinite;
}

@keyframes rotate-swap {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

/* Easter egg modal */
.easter-egg-modal {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 320px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: pop-in 0.4s ease;
}

@keyframes pop-in {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.easter-content {
    position: relative;
    z-index: 2;
}

.berry-emoji {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    animation: berry-bounce 0.5s ease infinite alternate;
}

@keyframes berry-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.easter-title {
    font-size: 18px;
    color: #888;
    margin-bottom: 4px;
}

.easter-company {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.easter-quote {
    font-size: 22px;
    color: #7CB342;
    line-height: 1.4;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 200;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    padding-bottom: 100px;
}

.app-footer a {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.app-footer a:hover {
    color: #1a1a1a;
}

.footer-link {
    color: #7CB342;
    font-weight: 600;
}

.footer-frog {
    animation: blink 3s ease infinite;
}

@keyframes blink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 380px) {
    .nav-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .filter-chip {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}