/*!
 * Gastelum Training Platform — Frontend
 * v1.0.0
 */

:root {
    --gtp-color-bg:           #ffffff;
    --gtp-color-surface:      #ffffff;
    --gtp-color-surface-2:    #f8fafc;
    --gtp-color-border:       #e2e8f0;
    --gtp-color-border-strong:#cbd5e1;
    --gtp-color-text:         #0f172a;
    --gtp-color-text-muted:   #475569;
    --gtp-color-text-subtle:  #64748b;
    --gtp-color-accent:       #1e40af;
    --gtp-color-accent-hover: #1e3a8a;
    --gtp-color-accent-soft:  #dbeafe;
    --gtp-color-success:      #059669;
    --gtp-color-success-soft: #d1fae5;
    --gtp-color-warn:         #d97706;
    --gtp-color-warn-soft:    #fef3c7;
    --gtp-color-error:        #dc2626;
    --gtp-color-locked:       #6b7280;
    --gtp-color-locked-soft:  #f3f4f6;
    --gtp-shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
    --gtp-shadow:     0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --gtp-shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.08);
    --gtp-shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.1);
    --gtp-radius:     10px;
    --gtp-radius-sm:  6px;
    --gtp-radius-lg:  16px;
    --gtp-font-display: 'Cinzel', Georgia, serif;
}

body.gtp-dark {
    --gtp-color-bg:           #0b1220;
    --gtp-color-surface:      #111827;
    --gtp-color-surface-2:    #1f2937;
    --gtp-color-border:       #1f2937;
    --gtp-color-border-strong:#374151;
    --gtp-color-text:         #f8fafc;
    --gtp-color-text-muted:   #cbd5e1;
    --gtp-color-text-subtle:  #94a3b8;
    --gtp-color-accent:       #60a5fa;
    --gtp-color-accent-soft:  #1e3a8a;
    --gtp-color-success:      #34d399;
    --gtp-color-success-soft: #064e3b;
    --gtp-color-locked:       #9ca3af;
    --gtp-color-locked-soft:  #1f2937;
}
body.gtp-dark .gtp-lesson-page,
body.gtp-dark .gtp-course-page,
body.gtp-dark .gtp-quiz-page,
body.gtp-dark .gtp-my-courses { background: var(--gtp-color-bg); color: var(--gtp-color-text); }

.gtp-course-progress-bar {
    margin: 0 0 28px; padding: 14px 18px;
    background: var(--gtp-color-surface);
    border: 1px solid var(--gtp-color-border);
    border-radius: var(--gtp-radius);
    box-shadow: var(--gtp-shadow-sm);
}
.gtp-course-progress-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 8px;
    font-size: 14px; color: var(--gtp-color-text-muted);
}
.gtp-course-progress-title { font-weight: 600; color: var(--gtp-color-text); text-decoration: none; }
.gtp-course-progress-title:hover { color: var(--gtp-color-accent); text-decoration: underline; }
.gtp-course-progress-pct { font-weight: 700; color: var(--gtp-color-accent); }

.gtp-progress-track { position: relative; height: 8px; background: var(--gtp-color-surface-2); border-radius: 999px; overflow: hidden; }
.gtp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gtp-color-accent), var(--gtp-color-accent-hover));
    border-radius: 999px;
    transition: width 0.4s ease;
}
.gtp-progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--gtp-color-text-muted); }
.gtp-progress-pct { font-weight: 600; color: var(--gtp-color-accent); }

.gtp-lesson-header { margin: 0 0 24px; }
.gtp-lesson-title {
    font-family: var(--gtp-font-display);
    font-size: 32px; font-weight: 600; line-height: 1.2;
    color: var(--gtp-color-text); margin: 0 0 12px;
}
.gtp-lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }

.gtp-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: var(--gtp-color-surface);
    border: 1px solid var(--gtp-color-border);
    border-radius: var(--gtp-radius-sm);
    color: var(--gtp-color-text-muted);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.15s ease; font-family: inherit;
}
.gtp-action-btn:hover { border-color: var(--gtp-color-border-strong); background: var(--gtp-color-surface-2); color: var(--gtp-color-text); }
.gtp-bookmark-btn--on { background: var(--gtp-color-warn-soft); border-color: var(--gtp-color-warn); color: var(--gtp-color-warn); }

.gtp-video-wrapper { margin: 0 0 28px; background: #000; border-radius: var(--gtp-radius); overflow: hidden; box-shadow: var(--gtp-shadow-lg); }
.gtp-locked-video { display: block; width: 100%; max-height: 70vh; background: #000; }
.gtp-video-status { padding: 14px 18px; background: var(--gtp-color-surface); border-top: 1px solid var(--gtp-color-border); }
.gtp-video-progress-bar { height: 4px; background: var(--gtp-color-surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.gtp-video-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--gtp-color-accent), var(--gtp-color-accent-hover));
    border-radius: 999px; transition: width 0.4s ease;
}
.gtp-video-meta { display: flex; gap: 6px; font-size: 13px; color: var(--gtp-color-text-muted); }
.gtp-video-time-watched { font-weight: 600; color: var(--gtp-color-accent); }
.gtp-video-help {
    display: flex; align-items: center; gap: 10px; padding: 10px 18px;
    background: var(--gtp-color-surface-2); border-top: 1px solid var(--gtp-color-border);
    font-size: 13px; color: var(--gtp-color-text-muted);
}
.gtp-keyboard-help-btn {
    margin-left: auto; padding: 4px 10px; background: transparent;
    border: 1px solid var(--gtp-color-border); border-radius: var(--gtp-radius-sm);
    color: var(--gtp-color-text-muted); cursor: pointer; font-size: 14px;
}
.gtp-keyboard-shortcuts { padding: 14px 18px; background: var(--gtp-color-surface-2); border-top: 1px solid var(--gtp-color-border); font-size: 13px; }
.gtp-keyboard-shortcuts ul { list-style: none; padding: 0; margin: 8px 0 0; }
.gtp-keyboard-shortcuts kbd {
    display: inline-block; padding: 2px 8px; background: var(--gtp-color-surface);
    border: 1px solid var(--gtp-color-border-strong); border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
    min-width: 1.5em; text-align: center;
}
.gtp-no-video {
    padding: 40px 28px; text-align: center;
    background: var(--gtp-color-surface-2); border: 1px dashed var(--gtp-color-border-strong);
    border-radius: var(--gtp-radius); color: var(--gtp-color-text-muted);
}
.gtp-no-video.gtp-warn { background: var(--gtp-color-warn-soft); border-color: var(--gtp-color-warn); color: var(--gtp-color-warn); }

.gtp-notes-panel {
    margin: 24px 0; background: var(--gtp-color-surface);
    border: 1px solid var(--gtp-color-border); border-radius: var(--gtp-radius); overflow: hidden;
}
.gtp-notes-summary {
    padding: 14px 18px; cursor: pointer; font-weight: 600;
    color: var(--gtp-color-text); list-style: none; display: flex; align-items: center; gap: 8px;
}
.gtp-notes-summary::-webkit-details-marker { display: none; }
.gtp-notes-summary::before { content: '▸'; color: var(--gtp-color-text-subtle); transition: transform 0.2s ease; }
.gtp-notes-panel[open] .gtp-notes-summary::before { transform: rotate(90deg); }
.gtp-notes-state { margin-left: auto; font-size: 12px; color: var(--gtp-color-text-subtle); }
.gtp-notes-state--saved { color: var(--gtp-color-success); }
.gtp-notes-state--error { color: var(--gtp-color-error); }
.gtp-notes-textarea {
    display: block; width: 100%; padding: 14px 18px; border: none;
    border-top: 1px solid var(--gtp-color-border);
    background: var(--gtp-color-bg); color: var(--gtp-color-text);
    font-family: inherit; font-size: 15px; line-height: 1.6; resize: vertical;
    min-height: 120px; outline: none; box-sizing: border-box;
}
.gtp-notes-help { margin: 0; padding: 10px 18px; background: var(--gtp-color-surface-2); border-top: 1px solid var(--gtp-color-border); font-size: 12px; color: var(--gtp-color-text-subtle); }

.gtp-quiz-section {
    margin: 24px 0; padding: 20px 24px;
    background: var(--gtp-color-accent-soft);
    border: 1px solid var(--gtp-color-accent);
    border-radius: var(--gtp-radius);
}
.gtp-quiz-section-title { margin: 0 0 12px; font-size: 18px; color: var(--gtp-color-text); }
.gtp-quiz-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gtp-quiz-status--passed { color: var(--gtp-color-success); }
.gtp-quiz-cta {
    display: inline-block; padding: 8px 16px;
    background: var(--gtp-color-accent); color: #fff !important;
    text-decoration: none; border-radius: var(--gtp-radius-sm);
    font-size: 14px; font-weight: 600;
}
.gtp-quiz-cta:hover { background: var(--gtp-color-accent-hover); }
.gtp-quiz-cta--retry { background: var(--gtp-color-warn); }

.gtp-lesson-content { margin: 24px 0 32px; line-height: 1.7; color: var(--gtp-color-text); }
.gtp-lesson-content h2, .gtp-lesson-content h3 { color: var(--gtp-color-text); margin-top: 1.5em; margin-bottom: 0.5em; }

.gtp-lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0 24px; }
@media (max-width: 640px) { .gtp-lesson-nav { grid-template-columns: 1fr; } }
.gtp-nav-btn {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 20px;
    border-radius: var(--gtp-radius); border: 1px solid var(--gtp-color-border);
    background: var(--gtp-color-surface); color: var(--gtp-color-text);
    text-decoration: none; cursor: pointer; transition: all 0.2s ease;
    font-family: inherit; text-align: left; box-shadow: var(--gtp-shadow-sm);
}
.gtp-nav-btn--prev { text-align: left; }
.gtp-nav-btn--next { text-align: right; }
.gtp-nav-btn--placeholder { background: transparent; border-color: transparent; box-shadow: none; cursor: default; }
.gtp-nav-btn--enabled:hover { border-color: var(--gtp-color-accent); background: var(--gtp-color-accent-soft); box-shadow: var(--gtp-shadow-md); transform: translateY(-1px); }
.gtp-nav-btn--locked { background: var(--gtp-color-locked-soft); border-color: var(--gtp-color-border); color: var(--gtp-color-locked); cursor: not-allowed; }
.gtp-nav-arrow { font-size: 18px; line-height: 1; }
.gtp-nav-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gtp-color-text-subtle); }
.gtp-nav-title { font-size: 15px; font-weight: 600; color: var(--gtp-color-text); }
.gtp-nav-btn--locked .gtp-nav-title, .gtp-nav-btn--locked .gtp-nav-label { color: var(--gtp-color-locked); }
.gtp-course-complete-banner {
    grid-column: 2 / 3; padding: 20px;
    background: linear-gradient(135deg, var(--gtp-color-success-soft), var(--gtp-color-accent-soft));
    border: 1px solid var(--gtp-color-success); border-radius: var(--gtp-radius);
    text-align: center; color: var(--gtp-color-success); font-size: 16px;
}
@media (max-width: 640px) { .gtp-course-complete-banner { grid-column: 1 / -1; } }

.gtp-locked-notice {
    padding: 56px 32px; text-align: center;
    background: var(--gtp-color-surface); border: 1px solid var(--gtp-color-border);
    border-radius: var(--gtp-radius-lg); box-shadow: var(--gtp-shadow); margin: 32px 0;
}
.gtp-locked-icon { font-size: 48px; margin-bottom: 16px; }
.gtp-locked-notice h2 { margin: 0 0 8px; font-family: var(--gtp-font-display); font-size: 24px; }

.gtp-completion-toast {
    position: fixed; top: 24px; right: 24px; z-index: 999999;
    display: flex; align-items: center; gap: 12px; padding: 16px 20px;
    background: var(--gtp-color-success-soft); border: 1px solid var(--gtp-color-success);
    border-radius: var(--gtp-radius); box-shadow: var(--gtp-shadow-lg);
    color: var(--gtp-color-success); font-size: 15px;
    animation: gtpToastIn 0.3s ease-out;
}
@keyframes gtpToastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.gtp-completion-icon { font-size: 22px; }
.gtp-completion-sub { font-size: 13px; color: var(--gtp-color-text-muted); }

.gtp-section-heading { font-family: var(--gtp-font-display); font-size: 26px; font-weight: 600; margin: 0 0 24px; }
.gtp-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.gtp-course-card {
    display: flex; flex-direction: column; background: var(--gtp-color-surface);
    border: 1px solid var(--gtp-color-border); border-radius: var(--gtp-radius-lg);
    overflow: hidden; box-shadow: var(--gtp-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gtp-course-card:hover { transform: translateY(-2px); box-shadow: var(--gtp-shadow-lg); }
.gtp-course-card-header { padding: 18px 20px 12px; border-bottom: 1px solid var(--gtp-color-border); }
.gtp-course-card-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.gtp-course-card-title a { color: var(--gtp-color-text); text-decoration: none; }
.gtp-course-card-body { padding: 18px 20px; flex: 1; }
.gtp-course-card-footer { padding: 12px 20px; background: var(--gtp-color-surface-2); border-top: 1px solid var(--gtp-color-border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.gtp-course-card-resume {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    background: var(--gtp-color-accent); color: #fff !important;
    text-decoration: none; border-radius: var(--gtp-radius-sm); font-size: 14px; font-weight: 600;
}
.gtp-course-card-resume:hover { background: var(--gtp-color-accent-hover); }
.gtp-course-card-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.gtp-badge-complete { background: var(--gtp-color-success-soft); color: var(--gtp-color-success); }
.gtp-shortcode-empty {
    padding: 48px 24px; text-align: center;
    background: var(--gtp-color-surface-2); border: 1px dashed var(--gtp-color-border-strong);
    border-radius: var(--gtp-radius); color: var(--gtp-color-text-muted);
}

.gtp-bookmark-list {
    list-style: none; padding: 0; margin: 0;
    background: var(--gtp-color-surface); border: 1px solid var(--gtp-color-border);
    border-radius: var(--gtp-radius); overflow: hidden;
}
.gtp-bookmark-list li { padding: 0; margin: 0; border-bottom: 1px solid var(--gtp-color-border); }
.gtp-bookmark-list li:last-child { border-bottom: none; }
.gtp-bookmark-list a { display: block; padding: 14px 18px; color: var(--gtp-color-text); text-decoration: none; }
.gtp-bookmark-list a::before { content: '★'; margin-right: 10px; color: var(--gtp-color-warn); }
.gtp-bookmark-list a:hover { background: var(--gtp-color-surface-2); }

.gtp-course-page { max-width: 880px; margin: 32px auto; padding: 0 24px; }
.gtp-course-title { font-family: var(--gtp-font-display); font-size: 36px; line-height: 1.15; color: var(--gtp-color-text); margin: 0 0 12px; }
.gtp-course-description { font-size: 17px; color: var(--gtp-color-text-muted); line-height: 1.65; margin: 0 0 20px; }
.gtp-curriculum {
    background: var(--gtp-color-surface); border: 1px solid var(--gtp-color-border);
    border-radius: var(--gtp-radius-lg); overflow: hidden; box-shadow: var(--gtp-shadow);
}
.gtp-curriculum-list { list-style: none; padding: 0; margin: 0; }
.gtp-curriculum-item { border-bottom: 1px solid var(--gtp-color-border); }
.gtp-curriculum-item:last-child { border-bottom: none; }
.gtp-curriculum-item:hover { background: var(--gtp-color-surface-2); }
.gtp-curriculum-link { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: var(--gtp-color-text); text-decoration: none; }
.gtp-curriculum-status {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    background: var(--gtp-color-surface-2); color: var(--gtp-color-text-muted);
    border: 1px solid var(--gtp-color-border);
}
.gtp-curriculum-item--complete .gtp-curriculum-status { background: var(--gtp-color-success); color: #fff; border-color: var(--gtp-color-success); }
.gtp-curriculum-item--locked .gtp-curriculum-status { background: var(--gtp-color-locked-soft); color: var(--gtp-color-locked); }
.gtp-curriculum-body { flex: 1; min-width: 0; }
.gtp-curriculum-title { font-size: 16px; font-weight: 600; color: var(--gtp-color-text); line-height: 1.3; margin: 0; }
.gtp-curriculum-item--locked .gtp-curriculum-title { color: var(--gtp-color-locked); }
.gtp-curriculum-meta { margin-top: 4px; font-size: 13px; color: var(--gtp-color-text-subtle); }
.gtp-curriculum-arrow { flex-shrink: 0; color: var(--gtp-color-text-subtle); }

@media print {
    .gtp-video-wrapper, .gtp-lesson-actions, .gtp-lesson-nav,
    .gtp-notes-panel, .gtp-course-progress-bar, .gtp-quiz-section,
    .gtp-keyboard-help-btn, .gtp-keyboard-shortcuts { display: none !important; }
    .gtp-lesson-content { font-size: 12pt; line-height: 1.5; }
}
