/**
 * PDF保護ビューワー スタイルシート
 * 講義スライドをダウンロード禁止で表示するためのスタイル
 */

/* ビューワーコンテナ */
.protected-pdf-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* PDFタイトルバー */
.pdf-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.pdf-title-bar .pdf-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-title-bar .pdf-title::before {
    content: "📄";
    font-size: 18px;
}

/* ページナビゲーション */
.pdf-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-navigation button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.pdf-navigation button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pdf-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-navigation .page-info {
    font-size: 13px;
    min-width: 80px;
    text-align: center;
}

/* PDFキャンバスエリア */
.pdf-canvas-container {
    position: relative;
    width: 100%;
    background: #525659;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 500px;
    max-height: 80vh;
    overflow: auto;
    padding: 20px;
}

.pdf-canvas-container canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #fff;
}

/* ローディングオーバーレイ */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #fff;
}

.pdf-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* エラーメッセージ */
.pdf-error {
    color: #ff6b6b;
    text-align: center;
    padding: 40px;
    font-size: 16px;
}

.pdf-error::before {
    content: "⚠️ ";
}

/* ログイン要求メッセージ */
.pdf-login-required {
    padding: 40px;
    text-align: center;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin: 20px 0;
}

.pdf-login-required h4 {
    color: #856404;
    margin-bottom: 10px;
}

.pdf-login-required p {
    color: #856404;
    margin-bottom: 15px;
}

.pdf-login-required a {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.pdf-login-required a:hover {
    background: #5a6fd6;
}

/* ズームコントロール */
.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pdf-zoom-controls button {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-zoom-controls .zoom-level {
    font-size: 12px;
    min-width: 50px;
    text-align: center;
}

/* フルスクリーンボタン */
.pdf-fullscreen-btn {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .pdf-title-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .pdf-navigation {
        width: 100%;
        justify-content: center;
    }
    
    .pdf-canvas-container {
        min-height: 400px;
        padding: 10px;
    }
    
    .pdf-zoom-controls {
        display: none;
    }
}

/* 印刷時は非表示 */
@media print {
    .protected-pdf-container {
        display: none !important;
    }
    
    .protected-pdf-container::after {
        content: "このコンテンツは印刷できません";
        display: block;
        padding: 20px;
        text-align: center;
        color: #666;
    }
}

/* 選択禁止（コピー防止） */
.protected-pdf-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ドラッグ禁止 */
.protected-pdf-container canvas,
.protected-pdf-container img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* キャンバスコンテナのみポインターイベント有効 */
.pdf-canvas-container {
    pointer-events: auto;
}






