/* LMS UI/UX Improvements CSS */

/* ============================================
   コンテンツタイプカードスタイル
   ============================================ */
.content-type-card {
    border: 2px solid var(--lms-border-color);
    border-radius: var(--lms-border-radius);
    padding: var(--lms-spacing-lg);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    background-color: var(--lms-white);
}

.content-type-card:hover {
    border-color: var(--lms-primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    background-color: var(--lms-light);
}

.content-type-card.selected {
    border-color: var(--lms-primary);
    border-width: 3px;
    background-color: rgba(13, 110, 253, 0.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

/* チェックアイコン: 未選択時は非表示 */
.content-type-card .check-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--lms-primary);
    font-size: 1.5rem;
    display: none;
}

/* 選択時のみチェックアイコンを表示 */
.content-type-card.selected .check-icon {
    display: block;
}

/* フォーカス時のアウトライン強化 */
.content-type-card:focus {
    outline: 2px solid var(--lms-primary);
    outline-offset: 2px;
}

.content-type-icon {
    font-size: 2.5rem;
    margin-bottom: var(--lms-spacing-md);
    display: block;
}

.content-type-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: var(--lms-spacing-sm);
}

.content-type-description {
    font-size: 0.875rem;
    color: var(--lms-text-secondary);
    margin-bottom: 0;
}

/* ============================================
   公開状態カードスタイル
   ============================================ */
.published-state {
    border-left: 4px solid var(--color-success-600) !important;
    background-color: var(--color-success-50);
    transition: var(--lms-transition-base);
}

.unpublished-state {
    border-left: 4px solid var(--color-warning-600) !important;
    background-color: var(--color-warning-50);
    transition: var(--lms-transition-base);
}

/* 公開状態バッジのスタイル強化 */
.published-state .badge,
.unpublished-state .badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

/* トグルスイッチの改善 */
.form-check-input:checked {
    background-color: var(--color-success-600);
    border-color: var(--color-success-600);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* ============================================
   Breadcrumbモバイル最適化
   ============================================ */
@media (max-width: 576px) {
    .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
    }

    .breadcrumb::-webkit-scrollbar {
        height: 4px;
    }

    .breadcrumb::-webkit-scrollbar-thumb {
        background-color: var(--lms-gray-400);
        border-radius: 2px;
    }

    .breadcrumb-item:not(:first-child):not(:last-child) {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .breadcrumb-item:first-child,
    .breadcrumb-item:last-child {
        flex-shrink: 0;
    }
}

/* ============================================
   ユーティリティクラス
   ============================================ */
.cursor-pointer {
    cursor: pointer !important;
}

.sticky-top-custom {
    position: sticky;
    top: 10px;
    z-index: var(--lms-z-sticky);
}

/* ============================================
   URLバリデーションフィードバック
   ============================================ */

/* Bootstrap input-groupとの統合 */
.has-validation .input-group-text {
    border-color: var(--lms-border-color);
}

.has-validation .form-control.is-valid ~ .input-group-text {
    border-color: var(--color-success-600);
}

.has-validation .form-control.is-invalid ~ .input-group-text {
    border-color: var(--color-error-600);
}

/* バリデーションフィードバックメッセージ */
.valid-feedback,
.invalid-feedback {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid-feedback i,
.invalid-feedback i {
    margin-right: 0.25rem;
}

/* URLバリデーションアイコン表示 */
.validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

.validation-icon.valid {
    color: var(--color-success-600);
}

.validation-icon.invalid {
    color: var(--color-error-600);
}

/* プログレスバーアクセシビリティ */
.progress-bar-accessible {
    position: relative;
}

/* コンテンツナビゲーションボタン */
.content-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: var(--lms-spacing-lg);
    padding-top: var(--lms-spacing-lg);
    border-top: 1px solid var(--lms-border-color);
}

.content-nav-buttons .btn {
    min-width: 120px;
}

/* テキストコンテンツ整形表示 */
.text-content-formatted {
    white-space: pre-wrap;
    padding: var(--lms-spacing-lg);
    background-color: var(--lms-gray-50);
    border-radius: var(--lms-border-radius);
    border: 1px solid var(--lms-border-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--lms-text-primary);
}

/* 未保存変更警告 */
.unsaved-changes-alert {
    position: sticky;
    top: 0;
    z-index: var(--lms-z-sticky);
    margin-bottom: var(--lms-spacing-md);
    animation: slideDown 0.3s ease-in-out;
}

/* アニメーション */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* フォーカス可視化強化 */
.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: var(--lms-focus-ring);
    outline: none;
}

/* ============================================
   レスポンシブ調整
   ============================================ */
@media (max-width: 768px) {
    .content-type-card {
        padding: var(--lms-spacing-md);
    }

    .content-type-icon {
        font-size: 2rem;
    }

    .content-nav-buttons {
        flex-direction: column;
        gap: var(--lms-spacing-sm);
    }

    .content-nav-buttons .btn {
        width: 100%;
    }
}
