/* =====================================================
   KKLMS Public Styles
   ===================================================== */

/* リセット */
.kklms-container *, .kklms-container *::before, .kklms-container *::after {
    box-sizing: border-box;
}

.kklms-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', Meiryo, sans-serif;
    color: #333;
    line-height: 1.7;
}

.kklms-container--narrow {
    max-width: 500px;
}

/* =====================================================
   カード
   ===================================================== */
.kklms-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.kklms-card-title {
    font-size: 1.5em;
    margin: 0 0 8px;
    color: #1a202c;
}

.kklms-card-desc {
    color: #718096;
    margin: 0 0 24px;
}

/* =====================================================
   アラート
   ===================================================== */
.kklms-alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.kklms-alert--success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
}

.kklms-alert--error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.kklms-alert--warning {
    background: #fffaf0;
    border: 1px solid #feebc8;
    color: #c05621;
}

.kklms-alert--info {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
}

.kklms-alert a {
    color: inherit;
    font-weight: 600;
}

/* =====================================================
   フォーム
   ===================================================== */
.kklms-form-section-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #2d3748;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.kklms-form-section-title:first-of-type {
    margin-top: 0;
}

.kklms-form-group {
    margin-bottom: 18px;
}

.kklms-form-row {
    display: flex;
    gap: 16px;
}

.kklms-form-row--half .kklms-form-group {
    flex: 1;
}

.kklms-label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.kklms-required {
    color: #e53e3e;
}

.kklms-input,
.kklms-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

.kklms-input:focus,
.kklms-textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.kklms-input--short {
    max-width: 200px;
}

.kklms-hint {
    font-size: 0.85em;
    color: #a0aec0;
    margin-top: 4px;
}

.kklms-form-submit {
    margin-top: 28px;
}

.kklms-form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.9em;
}

.kklms-form-footer a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 600;
}

.kklms-form-footer a:hover {
    text-decoration: underline;
}

/* WP Login Form override */
.kklms-container .login-username label,
.kklms-container .login-password label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.kklms-container .login-username input,
.kklms-container .login-password input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 16px;
}

.kklms-container .login-submit input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #4299e1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.kklms-container .login-submit input[type="submit"]:hover {
    background: #3182ce;
}

/* =====================================================
   ボタン
   ===================================================== */
.kklms-btn {
    display: inline-block;
    padding: 10px 22px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.kklms-btn--primary {
    background: #4299e1;
    color: #fff;
    border-color: #4299e1;
}

.kklms-btn--primary:hover {
    background: #3182ce;
    border-color: #3182ce;
    color: #fff;
}

.kklms-btn--outline {
    background: transparent;
    color: #4299e1;
    border-color: #4299e1;
}

.kklms-btn--outline:hover {
    background: #ebf8ff;
    color: #3182ce;
}

.kklms-btn--large {
    padding: 14px 32px;
    font-size: 1.1em;
}

.kklms-btn--small {
    padding: 5px 14px;
    font-size: 0.85em;
    border-radius: 6px;
}

.kklms-btn--text {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 0.85em;
}

.kklms-btn--danger {
    color: #e53e3e;
}

.kklms-btn--danger:hover {
    color: #c53030;
    text-decoration: underline;
}

.kklms-btn--disabled {
    opacity: .5;
    pointer-events: none;
}

/* =====================================================
   ダッシュボード
   ===================================================== */
.kklms-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.kklms-dashboard-title {
    font-size: 1.6em;
    margin: 0;
}

.kklms-dashboard-welcome {
    color: #718096;
    margin: 4px 0 0;
}

.kklms-dashboard-actions {
    display: flex;
    gap: 10px;
}

/* タブ */
.kklms-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
    gap: 4px;
}

.kklms-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: #718096;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
}

.kklms-tab:hover {
    color: #4a5568;
}

.kklms-tab--active {
    color: #4299e1;
    border-bottom-color: #4299e1;
}

/* =====================================================
   講座カード（マイページ）
   ===================================================== */
.kklms-course-heading {
    font-size: 1.2em;
    color: #2d3748;
    margin: 28px 0 14px;
    padding: 8px 14px;
    background: #f7fafc;
    border-left: 4px solid #4299e1;
    border-radius: 0 8px 8px 0;
}

.kklms-lecture-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow .2s;
}

.kklms-lecture-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.kklms-lecture-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.kklms-lecture-card-title {
    font-size: 1.1em;
    margin: 0;
    color: #1a202c;
}

.kklms-lecture-card-meta {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #718096;
}

.kklms-lecture-card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

/* ステータスバッジ */
.kklms-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    white-space: nowrap;
}

.kklms-status--enrolled {
    background: #ebf8ff;
    color: #2b6cb0;
}

.kklms-status--completed {
    background: #f0fff4;
    color: #276749;
}

.kklms-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    background: #ebf8ff;
    color: #2b6cb0;
}

/* =====================================================
   進捗ステップ
   ===================================================== */
.kklms-steps {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.kklms-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85em;
    color: #a0aec0;
    flex: 1;
    min-width: 140px;
}

.kklms-step--active {
    background: #ebf8ff;
    border-color: #bee3f8;
    color: #2b6cb0;
}

.kklms-step--done {
    background: #f0fff4;
    border-color: #c6f6d5;
    color: #276749;
}

.kklms-step-icon {
    font-size: 1.2em;
}

.kklms-step-label {
    font-weight: 600;
    flex: 1;
}

/* =====================================================
   講座一覧ページ
   ===================================================== */
.kklms-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.kklms-page-title {
    font-size: 1.5em;
    margin: 0;
}

.kklms-course-section {
    margin-bottom: 32px;
}

.kklms-course-desc {
    color: #718096;
    margin: -6px 0 16px 18px;
    font-size: 0.9em;
}

.kklms-lecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.kklms-lecture-grid-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    transition: box-shadow .2s;
}

.kklms-lecture-grid-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.kklms-lecture-grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.kklms-lecture-grid-item-header h4 {
    font-size: 1em;
    margin: 0;
    color: #1a202c;
}

.kklms-lecture-grid-item-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 0.85em;
    color: #718096;
}

.kklms-lecture-grid-item-action {
    margin-top: 14px;
}

/* =====================================================
   講座詳細
   ===================================================== */
.kklms-back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: #4299e1;
    text-decoration: none;
    font-size: 0.9em;
}

.kklms-back-link:hover {
    text-decoration: underline;
}

.kklms-lecture-detail-header {
    margin-bottom: 24px;
}

.kklms-lecture-detail-title {
    font-size: 1.5em;
    margin: 10px 0 0;
    color: #1a202c;
}

.kklms-lecture-detail-info {
    margin-bottom: 20px;
}

.kklms-info-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
}

.kklms-info-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 120px;
}

.kklms-lecture-detail-desc {
    margin: 20px 0;
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
    color: #4a5568;
}

.kklms-lecture-detail-action {
    margin-top: 24px;
    text-align: center;
}

/* 動画埋め込み */
.kklms-video-embed {
    margin-top: 12px;
}

.kklms-video-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 8px;
}

/* 空ステート */
.kklms-empty {
    text-align: center;
    padding: 48px 20px;
    color: #a0aec0;
}

.kklms-text-muted {
    color: #a0aec0;
    font-size: 0.85em;
}

/* =====================================================
   レスポンシブ
   ===================================================== */
@media screen and (max-width: 600px) {
    .kklms-container {
        padding: 12px;
    }

    .kklms-card {
        padding: 20px;
    }

    .kklms-form-row {
        flex-direction: column;
        gap: 0;
    }

    .kklms-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .kklms-dashboard-actions {
        width: 100%;
        flex-direction: column;
    }

    .kklms-dashboard-actions .kklms-btn {
        width: 100%;
        text-align: center;
    }

    .kklms-steps {
        flex-direction: column;
    }

    .kklms-lecture-grid {
        grid-template-columns: 1fr;
    }

    .kklms-lecture-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
