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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    background: #1976d2;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
}

.mobile-nav-user {
    padding: 0 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-user .username {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.mobile-nav-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.btn-logout-mobile {
    background: #1976d2;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    font-size: 1rem;
}

.btn-logout-mobile:hover {
    background: #1565c0;
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    margin-left: auto;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    transform-origin: center;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation - Hide desktop nav completely */
.page-nav {
    display: none;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.mobile-nav-overlay.active {
    display: block;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 999;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    padding: 0 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.mobile-nav-header h2 {
    color: #1976d2;
    margin: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    text-decoration: none;
    padding: 1rem 2rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.mobile-nav-link:hover {
    background: #f5f5f5;
}

.mobile-nav-link.active {
    color: #1976d2;
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
}

.mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
}

/* Login Page */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1976d2;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1976d2;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary {
    background: #1976d2;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1565c0;
}

/* Override width for search buttons */
.search-buttons .btn-primary {
    width: auto;
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.btn-secondary {
    background: #757575;
    color: white;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: #1976d2;
}

.tab-button.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Goals */
.goals-list {
    display: grid;
    gap: 1rem;
}

.goal-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.goal-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.goal-header h3 {
    color: #1976d2;
    font-size: 1.25rem;
}

.goal-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.3s;
}

.btn-edit {
    background: #4caf50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.goal-field {
    margin-bottom: 0.75rem;
    color: #666;
}

.goal-field strong {
    color: #333;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1976d2;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.fab:hover {
    background: #1565c0;
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto; /* Allow scrolling */
}

.modal.show {
    display: block;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    position: relative;
    max-height: 90vh; /* Limit height to 90% of viewport */
    overflow-y: auto; /* Allow scrolling within modal */
    margin-bottom: 5%; /* Add bottom margin for mobile */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #1976d2;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.alert-warning {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffb74d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-warning::before {
    content: "⚠️";
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1;
        padding: 0.75rem 1rem;
    }
    
    .goal-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .goal-actions {
        width: 100%;
    }
    
    .btn-edit,
    .btn-delete {
        flex: 1;
    }

    .hamburger-menu {
        display: flex;
    }

    .page-nav {
        display: none;
    }

    /* Mobile modal improvements */
    .modal {
        padding: 0;
        align-items: flex-start;
    }
    
    .modal-content {
        margin: 0;
        padding: 1.5rem 1rem;
        border-radius: 12px 12px 0 0;
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }
    
    .modal.show .modal-content {
        transform: translateY(0);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

}

/* Navigation */
.page-nav {
    display: none;
}

.nav-link {
    text-decoration: none;
    padding: 1rem 2rem;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.nav-link:hover {
    color: #1976d2;
}

.nav-link.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.mobile-nav-overlay.active {
    display: block;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 999;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    padding: 0 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.mobile-nav-header h2 {
    color: #1976d2;
    margin: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    text-decoration: none;
    padding: 1rem 2rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.mobile-nav-link:hover {
    background: #f5f5f5;
}

.mobile-nav-link.active {
    color: #1976d2;
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
}

.mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #1976d2;
    font-size: 1.5rem;
    margin: 0;
}

/* User Management */
.users-list {
    display: grid;
    gap: 1rem;
}

.user-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.user-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.user-header h3 {
    color: #1976d2;
    font-size: 1.25rem;
    margin: 0;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

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

.user-field {
    color: #666;
}

.user-field strong {
    color: #333;
}

.access-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.access-granted {
    background: #e8f5e9;
    color: #2e7d32;
}

.access-denied {
    background: #ffebee;
    color: #c62828;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #999;
}

/* Form Enhancements */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-help {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Freezer Inventory Styles */
.freezer-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.compartment-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.compartment-header {
    background: #1976d2;
    color: white;
    padding: 1rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.items-list {
    padding: 1rem;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    transition: all 0.3s;
}

.item-card:hover {
    background: #e3f2fd;
    border-color: #1976d2;
}

.item-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit-item,
.btn-delete-item {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
}

.btn-edit-item {
    background: #4caf50;
    color: white;
}

.btn-edit-item:hover {
    background: #45a049;
}

.btn-delete-item {
    background: #f44336;
    color: white;
}

.btn-delete-item:hover {
    background: #da190b;
}

.empty-compartment {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

.add-item-form {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 0.5rem;
}

.add-item-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.add-item-input:focus {
    outline: none;
    border-color: #1976d2;
}

.btn-add-item {
    background: #1976d2;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-add-item:hover {
    background: #1565c0;
}

/* Responsive adjustments for freezer */
@media (max-width: 768px) {
    .freezer-inventory {
        grid-template-columns: 1fr;
    }
    
    .item-card {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .item-actions {
        justify-content: center;
    }
    
    .add-item-form {
        flex-direction: column;
    }
}

/* Habits Page Styles */
.habits-container {
    margin-top: 2rem;
}

.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.habit-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.habit-selector label {
    font-weight: 500;
}

.habit-selector select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

.btn-pledge {
    background: #ff9800;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-pledge:hover:not(:disabled) {
    background: #f57c00;
}

.btn-pledge:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.calendar-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calendar-container h3 {
    margin-bottom: 1rem;
    color: #1976d2;
}

.calendar {
    width: 100%;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #666;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
    min-height: 60px;
    width: 100%;
}

.calendar-day:hover {
    background: #f5f5f5;
}

.calendar-day.future {
    color: #ccc;
    cursor: default;
}

.calendar-day.future:hover {
    background: transparent;
}

.calendar-day.current .date-number {
    font-weight: bold;
    color: #1976d2;
}

.date-number {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.indicators-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.pledge-indicator {
    width: 0;
    height: 0;
    border-left: 8px solid #0728ff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.outcome-indicator {
    width: 10px;
    height: 10px;
}

.outcome-indicator.success {
    background: #4caf50;
}

.outcome-indicator.failure {
    background: #f44336;
}

.outcome-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

/* Responsive adjustments for habits */
@media (max-width: 768px) {
    .habits-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .habit-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calendar-day {
        padding: 0.25rem;
        min-height: 50px;
    }
    
    .date-number {
        font-size: 0.8rem;
    }

    .indicators-container {
        gap: 0.25rem;
    }

    .pledge-indicator {
        border-left: 6px solid #0728ff;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
    }

    .outcome-indicator {
        width: 8px;
        height: 8px;
    }
}

/* Books Page Styles */
.books-container {
    position: relative;
    padding-bottom: 80px; /* Space for FAB */
}

.books-list {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.book-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

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

.book-main-info h3 {
    color: #1976d2;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-author {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-style: italic;
}

.book-genre {
    color: #888;
    font-size: 0.9rem;
}

.book-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.book-cover {
    text-align: center;
}

.book-cover img {
    max-width: 120px;
    max-height: 180px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    object-fit: cover;
}

.book-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-field {
    font-size: 0.9rem;
    color: #555;
}

.book-field strong {
    color: #333;
}

.book-field a {
    color: #1976d2;
    text-decoration: none;
}

.book-field a:hover {
    text-decoration: underline;
}

.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.tag-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #bbdefb;
}

.tags-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.selected-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #bbdefb;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-remove {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.tag-remove:hover {
    background: #1976d2;
    color: white;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #bbdefb;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .books-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .book-card {
        padding: 1rem;
    }
    
    .book-header {
        flex-direction: column;
        align-items: start;
    }
    
    .book-actions {
        flex-direction: row;
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .book-cover img {
        max-width: 100px;
        max-height: 150px;
    }
}

/* Comments Styles */
.book-comments {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comments-header strong {
    color: #333;
    font-size: 1rem;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.comment {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment:hover {
    background: #f0f1f2;
    border-color: #d0d0d0;
}

.comment-content p {
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.4;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.8rem;
}

.comment-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-link {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    text-decoration: underline;
    transition: color 0.3s;
}

.btn-link:hover {
    color: #1565c0;
}

.empty-comments {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 1rem;
}

/* Comment form styles */
#commentContent {
    resize: vertical;
    min-height: 80px;
}

/* Quotes Styles */
.book-quotes {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.quotes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.quotes-header strong {
    color: #333;
    font-size: 1rem;
}

.quotes-list {
    max-height: 300px;
    overflow-y: auto;
}

.quote {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #1976d2;
}

.quote:hover {
    background: #f0f1f2;
    border-color: #d0d0d0;
}

.quote-content blockquote {
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.4;
    font-style: italic;
    padding: 0;
    border: none;
    background: none;
}

.quote-page {
    margin-bottom: 0.5rem;
}

.quote-page small {
    color: #666;
    font-weight: 500;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.8rem;
}

.quote-actions {
    display: flex;
    gap: 0.75rem;
}

.empty-quotes {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 1rem;
}

/* Quote form styles */
#quoteContent {
    resize: vertical;
    min-height: 80px;
}

/* Book Search Section */
.books-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.filters select, .sorting select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

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

.books-list-new {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.book-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s;
}

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

.book-row:hover {
    background-color: #f5f5f5;
}

.book-row.header {
    font-weight: bold;
    background-color: #f8f9fa;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.book-cell {
    flex-shrink: 0;
    padding: 0 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-cell.cover { flex-basis: 60px; text-overflow: clip; }
.book-cell.title { flex-basis: 250px; flex-shrink: 1; white-space: normal; }
.book-cell.status { flex-basis: 100px; }
.book-cell.ownership { flex-basis: 100px; }
.book-cell.recommendation { flex-basis: 80px; text-align: center; }
.book-cell.rating { flex-basis: 70px; text-align: center; }
.book-cell.tags { flex-basis: 200px; white-space: normal; }
.book-cell.year { flex-basis: 70px; text-align: center; }
.book-cell.genre { flex-basis: 120px; }
.book-cell.media-type { flex-basis: 100px; }
.book-cell.actions { flex-basis: 80px; text-align: right; overflow: visible; }

.book-cell .book-title {
    font-weight: 500;
    color: #333;
}

.book-cell .book-author {
    font-size: 0.9rem;
    color: #666;
}

.book-cell.cover img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.fa-bullhorn.recommended {
    color: #ffc107;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    padding: 0.25rem;
}

.btn-icon:hover {
    color: #1976d2;
}

/* Book Actions Menu Styles */
.book-actions-menu {
    position: relative;
    display: inline-block;
}

.btn-menu {
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-menu:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.book-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 500;
}

.book-menu-dropdown .menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background-color 0.2s;
}

.book-menu-dropdown .menu-item:hover {
    background-color: #f5f5f5;
}

.book-menu-dropdown .menu-item i {
    width: 1rem;
    color: #666;
}

.book-menu-dropdown .menu-item:hover i {
    color: #1976d2;
}

.book-menu-dropdown .menu-item-danger {
    color: #d32f2f;
}

.book-menu-dropdown .menu-item-danger i {
    color: #d32f2f;
}

.book-menu-dropdown .menu-item-danger:hover {
    background-color: #ffebee;
}

@media (max-width: 1200px) {
    .book-cell.genre, .book-cell.year, .book-cell.media-type { display: none; }
}

@media (max-width: 992px) {
    .book-cell.tags, .book-cell.rating { display: none; }
    .book-cell.title { flex-basis: 200px; }
}

@media (max-width: 768px) {
    .books-controls { flex-direction: column; align-items: stretch; }
    .filters { flex-direction: column; }
    .book-cell.ownership { display: none; }
    .book-cell.title { flex-basis: 150px; }
}

@media (max-width: 576px) {
    .book-cell.status { display: none; }
    .book-row { padding: 0.5rem; }
    .book-cell { padding: 0 0.25rem; }
    .book-cell.title { font-size: 0.9rem; }
}

/* Book Details Page Styles */
.book-details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.book-details-nav {
    margin-bottom: 1.5rem;
}

.book-details-header {
    display: flex;
    gap: 2rem;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.book-details-cover {
    flex-shrink: 0;
    width: 200px;
}

.book-details-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.book-details-cover .no-cover {
    width: 200px;
    height: 300px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #ccc;
}

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

.book-details-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
}

.book-details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.meta-value {
    color: #333;
    font-weight: 500;
}

.book-details-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-badge.reading-status {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.ownership-status {
    background: #f3e5f5;
    color: #9c27b0;
}

.status-badge.media-type {
    background: #e8f5e9;
    color: #4caf50;
}

.status-badge.recommendation-status {
    background: #fff3e0;
    color: #ff9800;
}

.book-details-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.book-details-link {
    margin-top: 1rem;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

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

/* Tabs Styles */
.book-details-tabs {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tabs-nav {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-button:hover {
    color: #333;
}

.tab-button.active {
    color: #1976d2;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1976d2;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tab-header h3 {
    margin: 0;
    color: #333;
}

/* Comments and Quotes Form Styles */
.new-item-form {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.new-item-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.new-item-form textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.new-item-form input[type="number"] {
    width: 200px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.new-item-form input[type="number"]:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Items List Styles */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background-color 0.2s;
}

.item-card:hover {
    background: #f0f0f0;
}

.item-content {
    flex: 1;
    margin-right: 1rem;
}

.comment-text {
    color: #333;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.quote-text {
    color: #333;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    border-left: 3px solid #1976d2;
}

.item-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.page-number {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.item-date {
    color: #999;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* Book Search Section */
.book-search-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.book-search-section h2 {
    color: #333;
    margin-bottom: 1rem;
}

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

.search-input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.search-buttons {
    display: flex;
    gap: 0.5rem;
}

.search-results {
    margin-top: 1rem;
}

.search-results h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-result-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.search-result-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-result-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-result-details {
    flex: 1;
}

.search-result-details h4 {
    color: #333;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.search-result-details p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.95rem;
}

.search-result-details a {
    color: #1976d2;
    text-decoration: none;
}

.search-result-details a:hover {
    text-decoration: underline;
}

.search-results .loading,
.search-results .error,
.search-results .no-results {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.search-results .error {
    color: #d32f2f;
}

/* Make book title clickable */
.book-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-title-link:hover .book-title {
    color: #1976d2;
    text-decoration: underline;
}

/* Responsive Design for Search Controls */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-buttons {
        flex-direction: column;
        width: 100%;
    }

    .search-buttons .btn {
        width: 100%;
    }
}

/* Responsive Design for Book Details */
@media (max-width: 768px) {
    .book-details-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .book-details-cover {
        width: 150px;
    }
    
    .book-details-cover .no-cover {
        width: 150px;
        height: 225px;
    }
    
    .book-details-meta {
        justify-content: center;
    }
    
    .book-details-status {
        justify-content: center;
    }
    
    .book-details-tags {
        justify-content: center;
    }
    
    .tabs-nav {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .tab-button.active::after {
        display: none;
    }
    
    .tab-button.active {
        background: #e3f2fd;
        border-radius: 4px;
    }
    
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .new-item-form input[type="number"] {
        width: 100%;
    }
    
    .item-card {
        flex-direction: column;
    }
    
    .item-content {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .item-actions {
        align-self: flex-end;
    }
}

/* Book Lists Styles */
.book-lists-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
}

.queue-count {
    font-size: 1rem;
    color: #666;
    font-weight: normal;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.queue-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: move;
    position: relative;
}

.queue-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.queue-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.queue-item.drag-over {
    border-color: #1976d2;
    background: #f5f5f5;
    border-width: 2px;
}

.queue-item.drag-over-bottom {
    border-bottom: 3px solid #1976d2;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    color: #999;
    cursor: grab;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle i {
    font-size: 1.2rem;
}

.queue-item-cover {
    width: 60px;
    height: 90px;
    margin: 0 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.queue-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-cover i {
    font-size: 2rem;
    color: #999;
}

.queue-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.queue-position {
    font-weight: bold;
    color: #666;
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.queue-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.queue-item-title a {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-title a:hover {
    color: #1976d2;
    text-decoration: underline;
}

.queue-item-author {
    font-size: 0.95rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-media-type {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

.queue-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.btn-remove {
    color: #d32f2f;
}

.btn-remove:hover {
    background: #ffebee;
    color: #c62828;
}

/* Empty state for Book Lists */
.book-lists-container .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 2rem;
}

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

.empty-state p {
    font-size: 1.2rem;
    color: #666;
    margin: 0.5rem 0;
}

.empty-subtext {
    font-size: 1rem;
    color: #999;
    margin-bottom: 2rem;
}

/* Alert styles for Book Lists */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    min-width: 250px;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #4caf50;
    color: white;
}

.alert-error {
    background: #f44336;
    color: white;
}

.alert-info {
    background: #2196f3;
    color: white;
}

.alert.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Responsive design for Book Lists */
@media (max-width: 768px) {
    .queue-item {
        padding: 0.75rem;
    }
    
    .drag-handle {
        width: 20px;
    }
    
    .drag-handle i {
        font-size: 1rem;
    }
    
    .queue-item-cover {
        width: 50px;
        height: 75px;
        margin: 0 0.75rem;
    }
    
    .queue-position {
        font-size: 1rem;
    }
    
    .queue-item-title {
        font-size: 1rem;
    }
    
    .queue-item-author {
        font-size: 0.9rem;
    }
    
    .queue-item-media-type {
        display: none;
    }
    
    .alert-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .alert {
        min-width: auto;
    }
}

/* Inline genre editing */
.book-cell.genre:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

.inline-genre-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: inherit;
    background-color: white;
}

/* Inline mediaType editing */
.book-cell.media-type:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

.inline-media-type-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: inherit;
    background-color: white;
}

/* Live Documents Styles */
.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.documents-header h2 {
    color: #1976d2;
    font-size: 1.8rem;
    margin: 0;
}

.document-selector {
    flex: 1;
    max-width: 400px;
    min-width: 200px;
}

.document-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.document-dropdown:focus {
    outline: none;
    border-color: #1976d2;
}

.save-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.save-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.save-status.saving .save-indicator {
    background: #fff3e0;
    color: #f57c00;
}

.save-status.saving .save-indicator::before {
    content: "Saving...";
}

.save-status.saved .save-indicator {
    background: #e8f5e9;
    color: #4caf50;
}

.save-status.saved .save-indicator::before {
    content: "Saved";
}

.save-status.error .save-indicator {
    background: #ffebee;
    color: #f44336;
}

.save-status.error .save-indicator::before {
    content: "Error";
}

.document-editor-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: #e3f2fd;
    border-color: #1976d2;
}

.toolbar-btn:active {
    background: #bbdefb;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 0.5rem;
}

.document-editor {
    min-height: 500px;
    padding: 2rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    outline: none;
    overflow-y: auto;
    max-height: 70vh;
}

.document-editor:focus {
    outline: none;
}

.document-editor h2 {
    font-size: 1.75rem;
    margin: 1.5rem 0 0.75rem 0;
    color: #333;
}

.document-editor h3 {
    font-size: 1.4rem;
    margin: 1.25rem 0 0.5rem 0;
    color: #333;
}

.document-editor p {
    margin: 0.75rem 0;
}

.document-editor ul,
.document-editor ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.document-editor li {
    margin: 0.25rem 0;
}

.document-editor a {
    color: #1976d2;
    text-decoration: underline;
}

.document-editor a:hover {
    color: #1565c0;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

@media (max-width: 768px) {
    .documents-header {
        flex-direction: column;
        align-items: stretch;
    }

    .document-selector {
        max-width: 100%;
    }

    .editor-toolbar {
        gap: 0.5rem;
    }

    .toolbar-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        min-width: 32px;
    }

    .document-editor {
        padding: 1rem;
        min-height: 400px;
    }
}
