/* 絵本ビューアー カスタムスタイル */

body {
    font-family: 'Noto Sans JP', sans-serif;
}

/* スムーズトランジション */
* {
    transition: all 0.3s ease;
}

/* ドロップゾーンのスタイル */
#dropZone {
    transition: all 0.3s ease;
}

#dropZone.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* PDFキャンバスのスタイル */
#pdfCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 本棚のカードスタイル */
.book-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.book-cover i {
    font-size: 3rem;
    color: white;
    opacity: 0.8;
}

.book-info {
    padding: 1rem;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

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

.book-actions button {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

/* トースト通知のアニメーション */
#toast {
    animation: slideIn 0.3s ease;
}

#toast.show {
    display: block !important;
}

#toast.hide {
    animation: slideOut 0.3s ease;
}

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

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

/* PDFコンテナのスクロール */
#pdfContainer {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #pdfViewerScreen .border-b .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #pdfViewerScreen .flex.items-center.space-x-2 {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .book-card {
        margin-bottom: 1rem;
    }
    
    #libraryGrid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .flex.items-center.space-x-4 {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    #libraryGrid {
        grid-template-columns: 1fr;
    }
}

/* ローディングスピナー */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* モーダルのアニメーション */
#deleteModal {
    backdrop-filter: blur(4px);
}

#deleteModal.show {
    display: flex !important;
}

/* プログレスバーのアニメーション */
#progressBar {
    transition: width 0.5s ease;
}

/* カスタムスクロールバー */
#pdfContainer::-webkit-scrollbar {
    width: 8px;
}

#pdfContainer::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#pdfContainer::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#pdfContainer::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}