/* Modern Template - Custom Styles */
/* Works alongside Tailwind CSS */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.8);
}

/* Glassmorphism effect */
.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);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animated gradient background */
.gradient-bg {
    background: linear-gradient(-45deg, #1e1b4b, #312e81, #4338ca, #6366f1);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Card hover effect */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* Search input glow effect */
.search-glow:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Book cover placeholder */
.cover-placeholder {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .cover-placeholder {
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1b4b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Highlight search terms */
.highlight {
    background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
    padding: 0 2px;
    border-radius: 2px;
}

.dark .highlight {
    background: linear-gradient(120deg, #854d0e 0%, #a16207 100%);
    color: #fef9c3;
}

/* Member area specific styles */
.member-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
}

.dark .member-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 1px solid #4338ca;
}

/* Badge styles */
.badge-available {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.badge-borrowed {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.badge-unavailable {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Custom form styles */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Search Result Styling */
.search-result-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.dark .search-result-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-color: #4338ca;
}

.search-found-info {
    font-size: 15px;
    color: #475569;
    margin-bottom: 12px;
}

.dark .search-found-info {
    color: #cbd5e1;
}

.search-count {
    font-size: 28px;
    font-weight: 700;
    color: #6366f1;
    margin-right: 4px;
}

.dark .search-count {
    color: #818cf8;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.search-filter-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.filter-label {
    opacity: 0.85;
    margin-right: 4px;
}

.filter-value {
    font-weight: 600;
}

.search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.dark .search-meta {
    border-top-color: #4338ca;
}

.search-query-time {
    font-size: 12px;
    color: #94a3b8;
}

.xml-result-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.xml-result-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.xml-icon {
    width: 14px;
    height: 14px;
}

.search-page-info {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 8px;
}

.dark .search-page-info {
    background: #312e81;
    color: #a5b4fc;
}

.search-suggestions {
    background: #fef3c7;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.dark .search-suggestions {
    background: #451a03;
    color: #fcd34d;
}

.search-suggestion-link {
    color: #d97706;
    text-decoration: underline;
    font-weight: 600;
}

.search-word-suggest {
    color: #dc2626;
}

.search-word-correct {
    color: #16a34a;
}

/* Biblio List Items Styling */
.biblioRecord {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.dark .biblioRecord {
    background: #1e1b4b;
    border-color: #4338ca;
}

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

.biblioRecord .title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.biblioRecord .title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.dark .biblioRecord .title a {
    color: #f1f5f9;
}

.biblioRecord .title a:hover {
    color: #6366f1;
}

.biblioRecord .author,
.biblioRecord .publisher {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 4px;
}

.dark .biblioRecord .author,
.dark .biblioRecord .publisher {
    color: #94a3b8;
}

/* Paging Styles */
.paging-area {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 24px 0;
}

.paging-area a,
.paging-area span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.paging-area a {
    background: #f1f5f9;
    color: #475569;
}

.dark .paging-area a {
    background: #312e81;
    color: #c7d2fe;
}

.paging-area a:hover {
    background: #6366f1;
    color: white;
}

.paging-area span.current {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Modern Biblio List Styling */
.biblio-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.biblio-card {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.dark .biblio-card {
    background: #1e1b4b;
    border-color: #4338ca;
}

.biblio-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.biblio-cover-wrapper {
    flex-shrink: 0;
    width: 100px;
}

.biblio-cover-wrapper a {
    display: block;
}

.biblio-cover {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.biblio-cover-placeholder {
    width: 100px;
    height: 140px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .biblio-cover-placeholder {
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
}

.biblio-cover-placeholder svg {
    width: 40px;
    height: 40px;
    color: #a5b4fc;
}

.dark .biblio-cover-placeholder svg {
    color: #6366f1;
}

.biblio-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.biblio-title-wrapper {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.biblio-title {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.dark .biblio-title {
    color: #f1f5f9;
}

.biblio-title:hover {
    color: #6366f1;
}

.biblio-label {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.label-icon {
    height: 20px;
    width: auto;
}

.biblio-author {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.dark .biblio-author {
    color: #94a3b8;
}

.meta-label {
    font-weight: 600;
    color: #475569;
}

.dark .meta-label {
    color: #cbd5e1;
}

.biblio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.meta-item {
    font-size: 13px;
    color: #64748b;
}

.dark .meta-item {
    color: #94a3b8;
}

.availability-ok {
    color: #059669 !important;
}

.availability-none {
    color: #dc2626 !important;
}

.biblio-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.dark .biblio-actions {
    border-top-color: #312e81;
}

.btn-detail {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.btn-detail:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-xml {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.dark .btn-xml {
    background: #312e81;
    color: #c7d2fe;
}

.btn-xml:hover {
    background: #e2e8f0;
}

.dark .btn-xml:hover {
    background: #4338ca;
}

.mark-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}

.dark .mark-checkbox {
    color: #94a3b8;
}

.mark-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

/* Biblio Paging */
.biblio-paging {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.biblio-paging a,
.biblio-paging span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.biblio-paging a {
    background: #f1f5f9;
    color: #475569;
}

.dark .biblio-paging a {
    background: #312e81;
    color: #c7d2fe;
}

.biblio-paging a:hover {
    background: #6366f1;
    color: white;
}

.biblio-paging span.current,
.biblio-paging b {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Mark form styling */
.mark-form-action {
    margin: 16px 0;
}

.btn-basket {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn-basket:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Responsive for mobile */
@media (max-width: 640px) {
    .biblio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .biblio-cover-wrapper {
        width: 120px;
    }

    .biblio-cover,
    .biblio-cover-placeholder {
        width: 120px;
        height: 168px;
    }

    .biblio-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Visitor Page Styling */
.span4.offset4 {
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    float: none;
}

.visitor {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
}

.dark .visitor {
    background: transparent;
    border: none;
}

.visitor h4 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
    display: none;
    /* Hide if still present */
}

.dark .visitor h4 {
    color: #f1f5f9;
}

.visitor hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

.dark .visitor hr {
    border-top-color: #312e81;
}

.visitor .info {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
}

.dark .visitor .info {
    color: #94a3b8;
}

.visitor .photo {
    display: block;
    margin: 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #e0e7ff;
    object-fit: cover;
}

.dark .visitor .photo {
    border-color: #4338ca;
}

.control-group {
    margin-bottom: 20px;
}

.control-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.dark .control-label {
    color: #cbd5e1;
}

.input-block-level {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

.dark .input-block-level {
    background: #312e81;
    border-color: #4338ca;
    color: white;
}

.input-block-level:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    font-weight: 600;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(99, 102, 241, 0.4);
}

#counterInfo {
    text-align: center;
    margin-bottom: 16px;
    font-weight: 500;
    min-height: 24px;
}

.visitor small {
    display: block;
    text-align: center;
    color: #94a3b8;
    margin-top: 24px;
}

/* Fix container alignment in visitor page */
#visitor-content-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

/* Advanced Search AJAX Input Fields (Subject, Author) - Match Title field */
.ajaxInputField {
    width: 100%;
    padding: 0.5rem 1rem;
    /* py-2 px-4 */
    border-radius: 0.5rem;
    /* rounded-lg */
    background-color: #f1f5f9;
    /* bg-slate-100 */
    color: #1e293b;
    /* text-slate-800 */
    border: 1px solid #e2e8f0;
    /* border-slate-200 */
    font-size: 1rem;
    line-height: 1.5;
}

.ajaxInputField::placeholder {
    color: #94a3b8;
    /* placeholder-slate-400 */
}

.ajaxInputField:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.5);
    /* focus:ring-2 focus:ring-primary-400 */
    border-color: #818cf8;
}