/* ========================================
   PDFアップロードモーダル
   ======================================== */

.pdf-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.pdf-picker-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pdf-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.pdf-picker-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.pdf-picker-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
}

.pdf-picker-tabs .tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.pdf-picker-tabs .tab-btn:hover {
    color: #2196F3;
    background: #f5f5f5;
}

.pdf-picker-tabs .tab-btn.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
}

.pdf-picker-header .close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.pdf-picker-header .close-modal:hover {
    background: #f5f5f5;
    color: #333;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upload-area {
    padding: 20px 0;
}

.upload-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #2196F3;
    background: #f0f7ff;
}

.upload-dropzone i {
    font-size: 48px;
    color: #2196F3;
    margin-bottom: 16px;
}

.upload-dropzone p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.upload-dropzone small {
    display: block;
    margin-top: 12px;
    color: #999;
    font-size: 12px;
}

.upload-preview {
    margin-top: 20px;
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.text-muted {
    color: #999;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.pdf-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* PDF情報表示 */
.pdf-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pdf-details {
    flex: 1;
}

.pdf-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.pdf-size {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* PDFメタデータフォーム */
.pdf-metadata {
    margin-bottom: 20px;
}

.pdf-metadata .form-group {
    margin-bottom: 16px;
}

.pdf-metadata label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.pdf-metadata input,
.pdf-metadata select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.pdf-metadata input:focus,
.pdf-metadata select:focus {
    outline: none;
    border-color: #2196F3;
}

.pdf-metadata .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* PDFライブラリリスト */
.pdf-library-list {
    min-height: 400px;
}

.library-pdf-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s;
    background: white;
}

.library-pdf-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.pdf-icon {
    font-size: 48px;
    color: #f44336;
    min-width: 60px;
    text-align: center;
}

.library-pdf-card .pdf-info {
    flex: 1;
    padding: 0;
    background: none;
    margin: 0;
}

.library-pdf-card .pdf-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.pdf-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.pdf-meta span {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.pdf-filename {
    font-size: 12px;
    color: #999;
    margin: 0;
}

.pdf-actions {
    min-width: 80px;
}

/* PDFアップロードフィールド（フォーム内） */
.pdf-upload-field {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.pdf-upload-field input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    cursor: not-allowed;
    color: #666;
}

.pdf-upload-field .btn-upload {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-upload-field .btn-upload:hover {
    background: #1976D2;
}

.pdf-upload-field .btn-upload i {
    font-size: 14px;
}

.btn-select-pdf {
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    width: 100%;
}

.btn-select-pdf:hover {
    background: #1976D2;
}

.no-pdfs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
}

.no-pdfs i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 16px;
}

/* PDFビューアー */
.pdf-viewer-container {
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.pdf-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.pdf-viewer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #333;
}

.pdf-viewer-title i {
    font-size: 20px;
    color: #f44336;
}

.pdf-viewer-actions {
    display: flex;
    gap: 8px;
}

.pdf-viewer-actions button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-viewer-actions button:hover {
    background: #f5f5f5;
}

.pdf-viewer-actions .btn-download {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.pdf-viewer-actions .btn-download:hover {
    background: #1976D2;
}

.pdf-viewer-actions .btn-remove {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.pdf-viewer-actions .btn-remove:hover {
    background: #d32f2f;
}

.pdf-viewer-iframe {
    width: 100%;
    height: 800px;
    border: none;
    background: white;
}

.pdf-upload-section {
    padding: 24px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 24px;
}

.pdf-upload-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #333;
}

.pdf-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}

.pdf-upload-btn:hover {
    background: #1976D2;
}

.pdf-upload-btn i {
    font-size: 18px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .pdf-metadata .form-row {
        grid-template-columns: 1fr;
    }
    
    .library-pdf-card {
        flex-direction: column;
        text-align: center;
    }
    
    .pdf-viewer-iframe {
        height: 500px;
    }
}
