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

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

.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);
}

/* Mascot bubble */
.mascot-bubble {
    background: linear-gradient(135deg, #d4edda 0%, #b8d4be 100%);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* 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;
}

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

/* 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 20px rgba(0, 0, 0, 0.12);
    gap: 4px;
}

.nav-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 22px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Bricolage Grotesque', sans-serif;
}

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

/* 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;
}

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

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

.filter-select {
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    font-family: 'Bricolage Grotesque', sans-serif;
    cursor: pointer;
}

/* 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.2s ease;
}

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

.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;
}

.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;
}

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

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

.form-input:focus {
    outline: none;
    border-color: #1a1a1a;
}

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

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

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

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

/* 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-state-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    color: #888;
    font-size: 14px;
}

/* 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: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* 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: 32px;
    height: 32px;
    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);
}

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

/* 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: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        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;
}

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

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