html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #667eea;
    transition: color 0.3s ease;
}

a:hover, .btn-link:hover {
    color: #764ba2;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    font-weight: 600;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white !important;
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 0;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.alert {
    border-radius: 10px;
    border: none;
}

.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge {
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

.btn-secondary {
    background: #6c757d;
    border: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.spinner-border {
    color: #667eea;
}

/* Book Card Animations */
.book-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
}

.book-image {
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-image {
    transform: scale(1.1);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-overlay.show {
    opacity: 1;
}

/* Loading Skeletons */
.skeleton-card {
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-image {
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 15px 15px 0 0;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Enhanced Form Controls */
.input-group-text {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.form-select {
    border-radius: 8px;
}

/* Toast-like Alerts */
.alert {
    animation: slideIn 0.3s ease;
}

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

/* Sticky Card */
.sticky-top {
    z-index: 10;
}

/* Custom Nav Tabs */
.nav-tabs-custom {
    border-bottom: 2px solid #e0e0e0;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    transition: all 0.3s ease;
}

.nav-tabs-custom .nav-link:hover {
    border-bottom-color: #667eea;
    color: #667eea;
}

.nav-tabs-custom .nav-link.active {
    border-bottom-color: #667eea;
    color: #667eea;
    background: transparent;
    font-weight: 600;
}

/* Request Card */
.request-card {
    transition: all 0.3s ease;
}

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

/* Chat Card */
.chat-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.chat-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* Enhanced Empty States */
.card-body.text-center {
    padding: 3rem 1.5rem;
}

/* Image Error Handling */
img[onerror] {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* Modern Book Card Styles */
.page-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
}

.book-card-modern {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.book-card-modern:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.book-image-container {
    position: relative;
    height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.book-image-modern {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.book-card-modern:hover .book-image-modern {
    transform: scale(1.15);
}

.book-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.book-placeholder span {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.3);
}

.book-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.book-status-badge.status-active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.book-status-badge.status-created {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.book-status-badge.status-swapped {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.book-status-badge.status-inactive {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.book-overlay-modern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.book-card-modern:hover .book-overlay-modern {
    opacity: 1;
}

.book-content {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-author {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.book-author .bi {
    color: #667eea;
}

.book-summary {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

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

.btn-activate {
    flex: 1;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-activate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-activate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-deactivate {
    flex: 1;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-deactivate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-deactivate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Enhanced Alert Styles */
.alert {
    border-radius: 15px;
    border: none;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Enhanced Button Styles */
.btn-primary {
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4) !important;
}

/* Delete Button */
.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.btn-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1040;
}

.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.modal-body {
    padding: 1.5rem;
    color: #495057;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8f9fa;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Swap Request Page Styles */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.target-book-info {
    text-align: center;
}

.target-book-info h5 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 1rem;
}

.form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-select-lg:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select-lg option {
    padding: 0.5rem;
}

/* Swap Request Card Styles */
.request-card-modern {
    border-radius: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.request-card-modern:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.book-thumbnail {
    flex-shrink: 0;
}

.book-thumbnail img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Chat Styles */
.chat-container {
    border-radius: 15px;
    overflow: hidden;
}

.messages-container {
    background: #f8f9fa;
    padding: 1.5rem;
}

.message-bubble {
    animation: slideIn 0.3s ease;
}

.message-sent {
    display: flex;
    justify-content: flex-end;
}

.message-received {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message-sent .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-received .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #667eea;
    flex-shrink: 0;
}

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

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Toast Notifications */
.toast-container {
    z-index: 1100;
}

.toast {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    animation: toastSlideIn 0.3s ease;
}

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

.toast-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.toast-body {
    padding: 1rem;
    font-size: 0.95rem;
}

/* User Stats */
.user-stats-container {
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-card-books .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card-money .stat-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stat-card-earth .stat-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.stat-description {
    font-size: 0.85rem;
    color: #adb5bd;
}

.badges-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.badge-item {
    background: white;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.badge-icon {
    font-size: 1.5rem;
}

.badge-name {
    font-weight: 600;
    color: #2c3e50;
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
}

.mission-text {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.knowledge-quote {
    font-size: 1.3rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    padding: 1rem 2rem;
    text-align: center;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.knowledge-quote:hover {
    opacity: 1;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.feature-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    font-size: 3.5rem;
}

.feature-card .card-body {
    padding: 2rem;
}

/* Empty States */
.empty-state-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.empty-state-icon {
    font-size: 4rem;
    color: #dee2e6;
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease;
}

/* Softer Colors & Rounded Corners */
.card {
    border-radius: 20px;
}

.btn {
    border-radius: 12px;
}

.form-control, .form-select {
    border-radius: 12px;
}

/* Enhanced Book Cards */
.book-card {
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Request Card Enhancements */
.request-card-modern {
    border-radius: 18px;
    transition: all 0.3s ease;
}

.request-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

.language-switcher .dropdown {
    position: relative;
}

.language-btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.language-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.language-switcher .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 180px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: none;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: white;
    list-style: none;
    animation: dropdownFadeIn 0.2s ease;
}

.language-switcher .dropdown-menu.show {
    display: block;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #495057;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(3px);
    color: #495057;
}

.dropdown-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dropdown-item.active:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

.flag-icon {
    font-size: 1.2rem;
}

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

/* Create Book Page Styles */
.create-book-hero {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.create-book-card {
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.form-section-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.form-control-lg {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control-lg:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.form-label {
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.fw-semibold {
    font-weight: 600;
}

.form-text {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Image Upload Styles */
.image-upload-container {
    position: relative;
}

.image-preview {
    animation: fadeIn 0.3s ease;
}

.preview-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.preview-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.preview-image {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preview-info {
    flex: 1;
}

.image-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.image-placeholder:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e9ecef 100%);
}

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

.placeholder-icon {
    font-size: 3rem;
    color: #adb5bd;
}

/* Impact Info Card */
.impact-info-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 15px;
    padding: 1.5rem;
    border-left: 4px solid #4caf50;
    margin-top: 1rem;
}

.impact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.impact-info-card h6 {
    color: #2e7d32;
    font-weight: 700;
    margin: 0;
}

/* Form Actions */
.form-actions {
    background: linear-gradient(to top, #f8f9fa 0%, transparent 100%);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-primary.btn-lg:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary.btn-lg:hover {
    transform: translateY(-2px);
}

/* Validation Messages */
.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-message::before {
    content: "⚠";
    font-size: 1rem;
}

/* Enhanced Alert Styles for Create Book */
.create-book-card .alert {
    border-radius: 12px;
    border-left: 4px solid;
    padding: 1rem 1.25rem;
}

.create-book-card .alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left-color: #ffc107;
    color: #856404;
}

.create-book-card .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545;
    color: #721c24;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .create-book-hero {
        padding: 2rem 1.5rem;
    }
    
    .create-book-hero h1 {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}


/* ==========================================================================
   Responsive Design Adjustments
   ========================================================================== */

/*
 * Base adjustments for all smaller devices (tablets and phones).
 * This is a good starting point for mobile-first enhancements.
 */
@media (max-width: 992px) {
    .page-title {
        font-size: 2rem; /* Reduce title size on tablets */
    }

    .hero-section {
        padding: 2rem 0; /* Less vertical padding */
    }

    .stat-card {
        flex-direction: column; /* Stack icon and content vertically */
        text-align: center;
        gap: 1rem;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
}

/*
 * Adjustments for mobile phones (e.g., Galaxy S23 Ultra, iPhone).
 * Screen widths 768px and below.
 */
@media (max-width: 768px) {
    html, body {
        font-size: 15px; /* Slightly smaller base font for better fit */
    }

    .page-header {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .page-title {
        font-size: 1.8rem; /* Further reduce title size */
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .content {
        padding-top: 1rem;
    }

    .book-card-modern {
        border-radius: 15px;
    }

    .book-image-container {
        height: 250px; /* Shorter image height on mobile */
    }

    .book-content {
        padding: 1.25rem;
    }

    .book-title {
        font-size: 1.15rem;
    }

    .create-book-hero {
        padding: 2rem 1.5rem;
    }

        .create-book-hero h1 {
            font-size: 2rem;
        }

    .form-actions {
        flex-direction: column; /* Stack buttons vertically */
    }

        .form-actions .btn {
            width: 100%; /* Make buttons full-width */
        }

    .hero-buttons {
        flex-direction: column; /* Stack hero buttons */
        gap: 0.75rem;
    }

    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .modal-content {
        margin: 1rem; /* Add margin to avoid touching screen edges */
    }
}

/*
 * Fine-tuning for very small mobile screens.
 * Screen widths 480px and below.
 */
@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }

    .book-image-container {
        height: 200px;
    }

    .book-actions {
        flex-direction: column; /* Stack action buttons */
    }

    .btn-activate, .btn-deactivate {
        width: 100%;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .messages-container {
        padding: 1rem;
    }

    .message-content {
        max-width: 85%; /* Allow message bubbles to be a bit wider */
    }
}

