/**
 * Biblioteca Digital CCSA - Estilos Modernos
 * Bootstrap 5 + Custom Design
 *
 * @version 2.0.0
 * @author WS Design - wbdesignn.com.br
 */

:root {
    --primary-color: #000058;
    --primary-dark: #000088;
    --primary-light: #0000aa;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --info-color: #06b6d4;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" fill-opacity="1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,128C1248,117,1344,107,1392,101.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

/* Search Form */
.search-form-modern .input-group {
    border-radius: 50px;
    overflow: hidden;
    background: white;
}

.search-form-modern .form-control {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

.search-form-modern .form-control:focus {
    box-shadow: none;
}

.search-form-modern .input-group-text {
    padding: 0 1rem;
}

.search-form-modern button {
    border-radius: 0 50px 50px 0 !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Stats Cards */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem !important;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.stat-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* Book Cards */
.book-card {
    transition: all 0.3s ease;
    border-radius: 1rem !important;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    padding-top: 150%; /* Aspect ratio 2:3 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.book-cover-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover-wrapper img {
    transform: scale(1.05);
}

.no-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.no-cover i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.no-cover p {
    margin: 0;
    opacity: 0.7;
    font-weight: 500;
}

/* Navbar */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 88, 0.95) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Cards */
.card {
    border-radius: 1rem !important;
}

/* Buttons */
.btn {
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #0000aa);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    border: none;
    color: white;
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-item .page-link {
    border-radius: 0.5rem !important;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.page-item .page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
}

footer a:hover {
    text-decoration: underline !important;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.5em 0.8em;
    border-radius: 0.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 88, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .stat-card {
    animation: fadeInUp 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .search-form-modern .form-control {
        font-size: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltips */
.tooltip-inner {
    background: var(--dark-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
}

/* Dropdown */
.dropdown-menu {
    border-radius: 1rem !important;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--light-color);
    transform: translateX(5px);
}

/* Dashboard Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Form styles - Legacy compatibility */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: block;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 88, 0.1);
    outline: none;
}

fieldset.form-section {
    border: none;
    padding: 0;
    margin-bottom: 2rem;
}

fieldset.form-section legend {
    font-size: 1.3rem;
    font-weight: 600;
    color: #000058;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #000058;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.book-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn-primary {
    background: #000058 !important;
    border-color: #000058 !important;
}

.btn-primary:hover {
    background: #000088 !important;
    border-color: #000088 !important;
}

.readonly {
    background-color: #f8f9fa !important;
    cursor: not-allowed;
}

/* Print styles */
@media print {
    .navbar, footer, .btn {
        display: none !important;
    }
}
