/**
 * Custom CSS - Biblioteca Digital CCSA
 * Estilos personalizados e animações para Tailwind CSS
 * @version 3.0.0
 */

/* ========================================
   ANIMAÇÕES CUSTOMIZADAS
   ======================================== */

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes gradient-x {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

@keyframes flipX {
    0% {
        transform: perspective(400px) rotateX(0);
    }
    100% {
        transform: perspective(400px) rotateX(360deg);
    }
}

@keyframes zoomIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes zoomOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Classes de animação */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-shimmer {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s linear infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce-subtle {
    animation: bounce-subtle 2s ease-in-out infinite;
}

.animate-gradient-x {
    background-size: 200% 200%;
    animation: gradient-x 3s ease infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-flip {
    animation: flip 0.6s ease-in-out;
}

.animate-flip-x {
    animation: flipX 0.6s ease-in-out;
}

.animate-zoom-in {
    animation: zoomIn 0.3s ease-out;
}

.animate-zoom-out {
    animation: zoomOut 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

/* Hover animations */
.hover-rotate:hover {
    animation: rotate 0.3s ease-in-out;
}

.hover-wiggle:hover {
    animation: wiggle 0.5s ease-in-out;
}

.hover-heartbeat:hover {
    animation: heartbeat 0.6s ease-in-out;
}

/* Animação stagger para cards (aparecem em sequência) */
.stagger-item {
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }

/* ========================================
   GLASSMORPHISM EFFECTS
   ======================================== */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   GRADIENT BACKGROUNDS
   ======================================== */

.gradient-primary {
    background: linear-gradient(135deg, #000058 0%, #000088 100%);
}

.gradient-primary-light {
    background: linear-gradient(135deg, #000088 0%, #0000aa 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-sunset {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.gradient-aurora {
    background: linear-gradient(135deg, #000058 0%, #10b981 50%, #f59e0b 100%);
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    position: relative;
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 0, 88, 0.4);
}

/* ========================================
   SKELETON LOADERS
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
}

.skeleton-text {
    height: 1rem;
    margin: 0.5rem 0;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin: 0.5rem 0;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 2/3;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

.scroll-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   BADGES E TAGS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.badge-primary {
    background-color: #000058;
    color: white;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-danger {
    background-color: #ef4444;
    color: white;
}

.badge-outline {
    background-color: transparent;
    border: 2px solid currentColor;
}

/* ========================================
   BUTTONS CUSTOMIZADOS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #000058 0%, #000088 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #000088 0%, #0000aa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 88, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid #000058;
    color: #000058;
}

.btn-outline:hover {
    background: #000058;
    color: white;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

/* ========================================
   INPUTS E FORMS
   ======================================== */

.input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background-color: white;
}

.input:focus {
    outline: none;
    border-color: #000058;
    box-shadow: 0 0 0 4px rgba(0, 0, 88, 0.1);
}

.input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.input-error {
    border-color: #ef4444;
}

.input-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-success {
    border-color: #10b981;
}

.input-success:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #000058 0%, #000088 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 88, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 88, 0.4);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 9999;
    animation: slideDown 0.3s ease-out;
}

.toast-success {
    background-color: #10b981;
    color: white;
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

.toast-warning {
    background-color: #f59e0b;
    color: white;
}

.toast-info {
    background-color: #3b82f6;
    color: white;
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-gradient {
    background: linear-gradient(135deg, #000058 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blur-backdrop {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 640px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        min-width: auto;
        max-width: none;
    }
}

/* ========================================
   RIPPLE EFFECT
   ======================================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   LOADING SPINNERS
   ======================================== */

.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(0, 0, 88, 0.2);
    border-top-color: #000058;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 4px;
}

.spinner-white {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.spinner-accent {
    border-color: rgba(16, 185, 129, 0.2);
    border-top-color: #10b981;
}

/* Dots loader */
.dots-loader {
    display: inline-flex;
    gap: 0.5rem;
}

.dots-loader span {
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    background: #000058;
    border-radius: 50%;
    animation: bounce-subtle 1.4s ease-in-out infinite;
}

.dots-loader span:nth-child(1) {
    animation-delay: 0s;
}

.dots-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.progress {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #000058 0%, #10b981 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-bar-animated {
    animation: progress 2s ease-in-out;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    transition: all 0.2s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ========================================
   PULSE ANIMATIONS
   ======================================== */

.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    z-index: -1;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    animation: bounce-subtle 2s ease-in-out infinite;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.9375rem;
    color: #6b7280;
    max-width: 28rem;
}

/* ========================================
   IMAGE ZOOM ON HOVER
   ======================================== */

.image-zoom {
    overflow: hidden;
    border-radius: 0.5rem;
}

.image-zoom img {
    transition: transform 0.5s ease;
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* ========================================
   NOTIFICATION DOT
   ======================================== */

.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0.625rem;
    height: 0.625rem;
    background-color: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ========================================
   FOCUS VISIBLE STYLES
   ======================================== */

.focus-ring:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 0, 88, 0.2);
    border-radius: 0.375rem;
}

/* ========================================
   DIVIDERS
   ======================================== */

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider:not(:empty)::before {
    margin-right: 1rem;
}

.divider:not(:empty)::after {
    margin-left: 1rem;
}

/* ========================================
   FLOATING LABELS
   ======================================== */

.floating-label {
    position: relative;
}

.floating-label input,
.floating-label textarea {
    width: 100%;
    padding: 1rem 0.75rem 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.floating-label label {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #6b7280;
    pointer-events: none;
    transition: all 0.2s ease;
    background: white;
    padding: 0 0.25rem;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:focus + label,
.floating-label textarea:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.75rem;
    color: #000058;
}

/* ========================================
   MODAL BACKDROP
   ======================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    animation: scaleIn 0.3s ease-out;
    overflow: auto;
}

/* ========================================
   BOOK CARDS ULTRA MODERNOS v2.0
   ======================================== */

/* === NOVA Animação Tilt 3D === */
@keyframes cardTilt {
    0%, 100% { transform: perspective(1000px) rotateX(0) rotateY(0); }
    25% { transform: perspective(1000px) rotateX(2deg) rotateY(-2deg); }
    75% { transform: perspective(1000px) rotateX(-2deg) rotateY(2deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes borderGlow {
    0%, 100% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        filter: hue-rotate(30deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 0, 88, 0.2),
                    0 0 20px rgba(16, 185, 129, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 0, 88, 0.4),
                    0 0 40px rgba(16, 185, 129, 0.2);
    }
}

@keyframes slideUp3D {
    0% {
        opacity: 0;
        transform: perspective(1000px) translateY(60px) rotateX(-10deg);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) translateY(0) rotateX(0);
    }
}

@keyframes revealText {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes imageZoom {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.08) rotate(1deg); }
    100% { transform: scale(1.15) rotate(2deg); }
}

/* === Container dos Cards === */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    perspective: 1000px;
}

/* === Book Card Principal === */
.book-card-modern {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1.25rem;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    isolation: isolate;
}

/* Borda Gradiente Animada */
.book-card-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.25rem;
    padding: 2px;
    background: linear-gradient(
        135deg,
        #000058 0%,
        #10b981 25%,
        #3b82f6 50%,
        #8b5cf6 75%,
        #000058 100%
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderGlow 4s ease-in-out infinite;
    z-index: 1;
}

/* Efeito de Brilho Superior */
.book-card-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: all 0.6s ease;
    z-index: 10;
    pointer-events: none;
}

.book-card-modern:hover::after {
    animation: shine 0.8s ease forwards;
}

.book-card-modern:hover::before {
    opacity: 1;
}

.book-card-modern:hover {
    transform: translateY(-16px) scale(1.02) rotateX(5deg);
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 88, 0.25),
        0 15px 30px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 88, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: pulseGlow 2s ease-in-out infinite;
}

/* === Capa do Livro === */
.book-card-modern .book-cover {
    aspect-ratio: 2/3;
    overflow: hidden;
    position: relative;
    border-radius: 1.25rem 1.25rem 0 0;
}

.book-card-modern .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    filter: brightness(1) saturate(1);
}

.book-card-modern:hover .book-cover img {
    transform: scale(1.12) rotate(1.5deg);
    filter: brightness(1.05) saturate(1.1);
}

/* === Overlay com Gradiente Moderno === */
.book-card-modern .book-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 30%,
        rgba(0, 0, 40, 0.3) 60%,
        rgba(0, 0, 60, 0.95) 100%
    );
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

.book-card-modern:hover .book-overlay {
    opacity: 1;
}

.book-card-modern .book-overlay .text-white {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.1s;
}

.book-card-modern:hover .book-overlay .text-white {
    transform: translateY(0);
    opacity: 1;
}

/* === Badge de Status Animado === */
.book-card-modern .status-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 15;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-card-modern:hover .status-badge,
.book-card-modern .status-badge.always-visible {
    transform: scale(1);
    opacity: 1;
}

/* === Informações do Livro === */
.book-card-modern .book-info {
    padding: 1rem 1.25rem 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    z-index: 2;
}

.book-card-modern .book-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 88, 0.1), transparent);
}

.book-card-modern .book-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.book-card-modern:hover .book-title {
    color: #000058;
}

.book-card-modern .book-author {
    font-size: 0.8rem;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.book-card-modern:hover .book-author {
    color: #10b981;
}

.book-card-modern .book-year {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* === Ícone de Ação no Hover === */
.book-card-modern .action-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 20;
    backdrop-filter: blur(10px);
}

.book-card-modern .action-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #000058;
    transition: transform 0.3s ease;
}

.book-card-modern:hover .action-icon {
    transform: translate(-50%, -50%) scale(1);
}

.book-card-modern:hover .action-icon:hover svg {
    transform: scale(1.2);
}

/* === Efeito Reflexo === */
.book-card-modern .reflection {
    position: absolute;
    bottom: -50%;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 88, 0.1),
        transparent
    );
    transform: scaleY(-1);
    opacity: 0;
    filter: blur(2px);
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.book-card-modern:hover .reflection {
    opacity: 0.3;
}

/* === Animação Stagger Aprimorada === */
.stagger-item {
    opacity: 0;
    animation: slideUp3D 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }
.stagger-item:nth-child(n+11) { animation-delay: 0.55s; }

/* === Variante: Card com Efeito Holográfico === */
.book-card-holographic {
    position: relative;
}

.book-card-holographic::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        45deg,
        #ff0080, #ff8c00, #40e0d0, #7b68ee, #ff0080
    );
    background-size: 400% 400%;
    animation: borderGlow 3s ease infinite;
    border-radius: 1.35rem;
    z-index: -1;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.book-card-holographic:hover::before {
    opacity: 0.6;
}

/* === Skeleton Loading para Cards === */
.book-card-skeleton {
    background: linear-gradient(145deg, #f0f0f0 0%, #e8e8e8 100%);
    border-radius: 1.25rem;
    overflow: hidden;
}

.book-card-skeleton .skeleton-cover {
    aspect-ratio: 2/3;
    background: linear-gradient(
        90deg,
        #e8e8e8 0%,
        #f5f5f5 50%,
        #e8e8e8 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.book-card-skeleton .skeleton-info {
    padding: 1rem 1.25rem 1.25rem;
}

.book-card-skeleton .skeleton-title {
    height: 1rem;
    width: 80%;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.book-card-skeleton .skeleton-author {
    height: 0.75rem;
    width: 60%;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

/* === Responsividade === */
@media (max-width: 640px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .book-card-modern:hover {
        transform: translateY(-8px) scale(1.01);
    }

    .book-card-modern .book-info {
        padding: 0.875rem 1rem 1rem;
    }

    .book-card-modern .book-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .book-card-modern .book-title {
        font-size: 0.8rem;
    }
}

/* Telas muito pequenas (< 375px) */
@media (max-width: 375px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .book-card-modern {
        border-radius: 0.75rem;
    }

    .book-card-modern .book-info {
        padding: 0.75rem 0.875rem 0.875rem;
    }

    .book-card-modern .book-title {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
    .book-card-modern {
        background: linear-gradient(145deg, #1e1e2e 0%, #2a2a3e 100%);
    }

    .book-card-modern .book-info {
        background: linear-gradient(180deg, #1e1e2e 0%, #252538 100%);
    }

    .book-card-modern .book-title {
        color: #f1f5f9;
    }

    .book-card-modern:hover .book-title {
        color: #60a5fa;
    }
}

/* 2. Stats Card com Neomorphism */
.stats-card-neo {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow:
        12px 12px 24px #d1d1d1,
        -12px -12px 24px #ffffff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card-neo::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 88, 0.05) 50%, transparent 100%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.stats-card-neo:hover::before {
    transform: rotate(45deg) translateY(50%);
}

.stats-card-neo:hover {
    transform: translateY(-4px);
    box-shadow:
        16px 16px 32px #c1c1c1,
        -16px -16px 32px #ffffff;
}

.stats-card-neo .icon-wrapper {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #000058, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stats-card-neo .icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stats-card-neo:hover .icon-wrapper::before {
    transform: translateX(100%);
}

/* 3. Dashboard Card com Glow Effect */
.dashboard-card-glow {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 1.5rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.dashboard-card-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 0, 88, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.6s ease;
    pointer-events: none;
}

.dashboard-card-glow:hover::before {
    opacity: 1;
    animation: glow-move 3s ease-in-out infinite;
}

.dashboard-card-glow:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 88, 0.15),
        0 0 50px rgba(16, 185, 129, 0.2),
        0 0 0 1px rgba(0, 0, 88, 0.05);
}

@keyframes glow-move {
    0%, 100% { transform: translate(0%, 0%); }
    25% { transform: translate(20%, 20%); }
    50% { transform: translate(-20%, 20%); }
    75% { transform: translate(20%, -20%); }
}

.dashboard-card-glow .stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #000058, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 4. Card com Borda Gradiente Animada */
.card-gradient-border {
    position: relative;
    background: white;
    border-radius: 1rem;
    padding: 2px;
    overflow: hidden;
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: conic-gradient(
        from 0deg,
        #000058,
        #10b981,
        #f59e0b,
        #ef4444,
        #8b5cf6,
        #000058
    );
    animation: rotate 4s linear infinite;
}

.card-gradient-border::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: white;
    border-radius: calc(1rem - 2px);
    z-index: 1;
}

.card-gradient-border .card-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
}

/* 5. Button com Liquid Effect */
.btn-liquid {
    position: relative;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 3rem;
    background: linear-gradient(135deg, #000058, #000088);
    color: white;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-liquid::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 3rem;
    padding: 2px;
    background: linear-gradient(135deg, #10b981, #3b82f6, #8b5cf6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-liquid::after {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-liquid:hover::before {
    opacity: 1;
}

.btn-liquid:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.btn-liquid:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 88, 0.3);
}

.btn-liquid:active {
    transform: translateY(0);
}

/* 6. Search Bar Moderno com Glow */
.search-bar-glow {
    position: relative;
    width: 100%;
}

.search-bar-glow input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    border: 2px solid transparent;
    border-radius: 3rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-bar-glow input:focus {
    outline: none;
    border-color: #000058;
    box-shadow:
        0 0 0 4px rgba(0, 0, 88, 0.1),
        0 0 30px rgba(16, 185, 129, 0.2),
        0 10px 20px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.search-bar-glow::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 3rem;
    background: linear-gradient(135deg, #000058, #10b981);
    opacity: 0;
    z-index: -1;
    filter: blur(15px);
    transition: opacity 0.3s ease;
}

.search-bar-glow:focus-within::before {
    opacity: 0.4;
}

/* Loading State com Shimmer */
.card-loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

/* Micro-interactions em Botões */
.btn-micro {
    position: relative;
    overflow: hidden;
}

.btn-micro::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.btn-micro:active::after {
    transform: scale(2);
    transition: transform 0s;
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Mantém animações essenciais mas mais rápidas */
    .spinner {
        animation-duration: 1s !important;
    }

    /* Desabilita efeitos complexos para acessibilidade */
    .book-card-modern:hover,
    .dashboard-card-glow:hover,
    .stats-card-neo:hover,
    .btn-liquid:hover {
        transform: none !important;
    }

    .card-gradient-border::before,
    .dashboard-card-glow::before {
        animation: none !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .back-to-top,
    .toast,
    .spinner,
    .modal-backdrop {
        display: none !important;
    }
}

/* ========================================
   BOOTSTRAP COMPATIBILITY STYLES
   ======================================== */

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.row > * {
    padding: 0.75rem;
}

.col-md-3 { flex: 0 0 100%; max-width: 100%; }
.col-md-4 { flex: 0 0 100%; max-width: 100%; }
.col-md-6 { flex: 0 0 100%; max-width: 100%; }
.col-md-8 { flex: 0 0 100%; max-width: 100%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Spacing Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.gap-2 { gap: 0.5rem !important; }

/* Display & Flex */
.d-flex { display: flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-muted { color: #6b7280 !important; }
.text-white { color: white !important; }
.w-100 { width: 100% !important; }

/* Headings */
.h2 { font-size: 1.75rem; font-weight: 700; }
.h3 { font-size: 1.5rem; font-weight: 600; }
.h5 { font-size: 1.125rem; font-weight: 600; }

/* ========================================
   FORM STYLES
   ======================================== */

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1f2937;
    background-color: #fff;
    background-clip: padding-box;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #000058;
    box-shadow: 0 0 0 4px rgba(0, 0, 88, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9375rem;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Form Sections */
.form-section,
fieldset.form-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section legend,
fieldset.form-section legend {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000058;
    padding: 0 0.75rem;
    margin-left: -0.75rem;
    background: white;
    width: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #000058;
    box-shadow: 0 0 0 4px rgba(0, 0, 88, 0.1);
}

.form-group input.readonly,
.form-group input[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

/* ========================================
   BUTTON STYLES (Bootstrap Compatibility)
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background: linear-gradient(135deg, #000058 0%, #000088 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #000088 0%, #0000aa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 88, 0.3);
    color: white;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.btn-close {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    font-size: 1.25rem;
}

.btn-close:hover {
    opacity: 1;
}

.btn-close::before {
    content: '×';
}

.btn-link {
    background: none;
    border: none;
    color: #000058;
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover {
    color: #000088;
}

/* ========================================
   BADGE STYLES
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
}

.bg-primary { background-color: #000058 !important; color: white; }
.bg-success { background-color: #10b981 !important; color: white; }
.bg-warning { background-color: #f59e0b !important; color: white; }
.bg-danger { background-color: #ef4444 !important; color: white; }
.bg-secondary { background-color: #6b7280 !important; color: white; }
.bg-info { background-color: #3b82f6 !important; color: white; }

/* ========================================
   ALERT STYLES
   ======================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger,
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-dismissible {
    justify-content: space-between;
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

/* ========================================
   PROFILE PAGE STYLES
   ======================================== */

.profile-container {
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin: 2rem 0;
}

.profile-header {
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, #000058 0%, #000088 100%);
    color: white;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 3rem;
    color: #000058;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.info-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 88, 0.1);
    transform: translateY(-2px);
}

.info-card h5 {
    color: #000058;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

/* ========================================
   LOANS PAGE STYLES
   ======================================== */

.loans-container {
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin: 2rem 0;
}

.loan-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.loan-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 88, 0.1);
    transform: translateY(-2px);
}

.loan-active {
    border-left: 4px solid #10b981;
}

.loan-overdue {
    border-left: 4px solid #ef4444;
    background: linear-gradient(to right, #fef2f2 0%, #ffffff 20%);
}

.loan-returned {
    border-left: 4px solid #6b7280;
    opacity: 0.75;
}

.loan-card h5 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ========================================
   BOOK FORM STYLES
   ======================================== */

.book-form {
    max-width: 900px;
    margin: 0 auto;
}

.image-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px dashed #e5e7eb;
}

.image-preview img {
    max-width: 200px;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   TABLE STYLES
   ======================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========================================
   PARALLAX EFFECTS
   ======================================== */

/* Container base para parallax */
.parallax-container {
    position: relative;
    overflow: hidden;
}

/* Hero Parallax Section */
.parallax-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 200%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    z-index: -1;
}

.parallax-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image:
        linear-gradient(30deg, #000058 12%, transparent 12.5%, transparent 87%, #000058 87.5%, #000058),
        linear-gradient(150deg, #000058 12%, transparent 12.5%, transparent 87%, #000058 87.5%, #000058),
        linear-gradient(30deg, #000058 12%, transparent 12.5%, transparent 87%, #000058 87.5%, #000058),
        linear-gradient(150deg, #000058 12%, transparent 12.5%, transparent 87%, #000058 87.5%, #000058),
        linear-gradient(60deg, rgba(0,0,88,0.3) 25%, transparent 25.5%, transparent 75%, rgba(0,0,88,0.3) 75%, rgba(0,0,88,0.3)),
        linear-gradient(60deg, rgba(0,0,88,0.3) 25%, transparent 25.5%, transparent 75%, rgba(0,0,88,0.3) 75%, rgba(0,0,88,0.3));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
    will-change: transform;
}

/* Floating elements with parallax */
.parallax-float {
    animation: parallax-float 6s ease-in-out infinite;
}

.parallax-float-slow {
    animation: parallax-float 8s ease-in-out infinite;
}

.parallax-float-fast {
    animation: parallax-float 4s ease-in-out infinite;
}

@keyframes parallax-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(1deg);
    }
    50% {
        transform: translateY(-5px) rotate(0deg);
    }
    75% {
        transform: translateY(-20px) rotate(-1deg);
    }
}

/* Depth layers for parallax */
.parallax-layer-back {
    transform: translateZ(-300px) scale(2);
}

.parallax-layer-base {
    transform: translateZ(0);
}

.parallax-layer-front {
    transform: translateZ(100px) scale(0.9);
}

/* Scroll-triggered parallax elements */
.parallax-scroll {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.parallax-scroll-slow {
    --parallax-speed: 0.3;
}

.parallax-scroll-medium {
    --parallax-speed: 0.5;
}

.parallax-scroll-fast {
    --parallax-speed: 0.8;
}

/* Parallax cards effect */
.parallax-card {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.parallax-card:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(-5deg);
}

.parallax-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.parallax-card:hover::before {
    opacity: 1;
}

/* 3D tilt effect */
.tilt-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-3d-content {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Parallax sections */
.parallax-section {
    position: relative;
    padding: 4rem 0;
    overflow: hidden;
}

.parallax-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        rgba(248, 250, 252, 0) 0%,
        rgba(248, 250, 252, 0.8) 20%,
        rgba(248, 250, 252, 1) 50%,
        rgba(248, 250, 252, 0.8) 80%,
        rgba(248, 250, 252, 0) 100%
    );
    pointer-events: none;
    z-index: 0;
}

.parallax-section > * {
    position: relative;
    z-index: 1;
}

/* Decorative parallax shapes */
.parallax-shape {
    position: absolute;
    pointer-events: none;
    opacity: 0.1;
}

.parallax-circle {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, #000058 0%, #10b981 100%);
    filter: blur(80px);
}

.parallax-blob {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #000058 0%, #0000aa 50%, #10b981 100%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    filter: blur(100px);
    animation: blob-morph 15s ease-in-out infinite;
}

@keyframes blob-morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 50% 50% / 40% 70% 30% 60%;
    }
    75% {
        border-radius: 40% 60% 70% 30% / 60% 40% 60% 40%;
    }
}

/* Reveal on scroll with parallax */
.reveal-parallax {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-parallax.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-parallax-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-parallax-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-parallax-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-parallax-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger animation for grid items */
.parallax-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.parallax-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.parallax-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.parallax-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.parallax-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.parallax-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.parallax-stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.parallax-stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }
.parallax-stagger.visible > *:nth-child(8) { transition-delay: 0.4s; }
.parallax-stagger.visible > *:nth-child(9) { transition-delay: 0.45s; }
.parallax-stagger.visible > *:nth-child(10) { transition-delay: 0.5s; }

.parallax-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Mouse follow parallax effect indicator */
.parallax-mouse {
    transition: transform 0.1s ease-out;
}

/* Glassmorphism with parallax */
.parallax-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 88, 0.1);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .parallax-float,
    .parallax-float-slow,
    .parallax-float-fast,
    .parallax-blob,
    .parallax-scroll,
    .reveal-parallax,
    .reveal-parallax-left,
    .reveal-parallax-right,
    .parallax-stagger > * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}
