/* ============================================
   VIDEO PLAYER - Fixed aspect ratio support
   ============================================ */
.video-container {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 10px auto;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    width: fit-content;
    max-width: 100%;
}

.video-container.video-float-left {
    float: left;
    margin: 0 20px 15px 0;
    max-width: 45%;
}

.video-container.video-float-right {
    float: right;
    margin: 0 0 15px 20px;
    max-width: 45%;
}

.video-container.video-in-row {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: none;
    margin: 0;
}

/* Aspect wrapper for fixed ratio videos */
.video-aspect-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-fixed-ratio .video-aspect-wrapper {
    width: 100%;
}

.media-video {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Non-fixed ratio: limit by viewport */
.video-container:not(.video-fixed-ratio) .media-video {
    max-height: calc(80vh - 120px);
}

/* Fixed ratio: video fills the container */
.video-fixed-ratio .media-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.9);
    width: 100%;
    flex-shrink: 0;
}

.video-controls button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.video-controls button:hover {
    color: #4fc3f7;
}

.video-progress {
    flex: 1;
    height: 5px;
    cursor: pointer;
    accent-color: #4fc3f7;
    min-width: 50px;
}

.video-time {
    color: #fff;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================
   VIDEO START OVERLAY
   ============================================ */
.video-start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 20px;
    cursor: pointer;
}

.video-start-overlay.hidden {
    display: none;
}

.video-start-title {
    color: #fff;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
    max-width: 90%;
    line-height: 1.3;
    /* Dynamic font size set via JS based on title length */
    font-size: 1.4rem;
}

.video-start-play {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid #fff;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-start-play:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.video-start-play i {
    margin-left: 5px; /* Optical centering for play icon */
}

/* ============================================
   VIDEO END OVERLAY
   ============================================ */
.video-end-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 20px;
}

.video-end-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.video-end-replay {
    padding: 12px 30px;
    border-radius: 30px;
    background: #fff;
    border: none;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-end-replay:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.video-end-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 100%;
}

.video-end-link {
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.video-end-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
    color: #fff;
}

.video-end-link.primary-link {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.7);
}

.video-end-link.primary-link:hover {
    background: rgba(76, 175, 80, 0.5);
    border-color: #4caf50;
}

/* ============================================
   MEDIA ROW - Fixed ratio videos side by side
   ============================================ */
.media-row {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
}

.media-row[data-media-count="1"] > * {
    max-width: 100%;
}

.media-row[data-media-count="2"] > * {
    flex: 1;
    max-width: calc(50% - 8px);
}

.media-row[data-media-count="3"] > * {
    flex: 1;
    max-width: calc(33.33% - 10px);
}

/* Fixed ratio row: videos have same height, widths based on ratios */
.media-row.media-row-fixed-ratio {
    align-items: stretch;
}

.media-row.media-row-fixed-ratio > .content-upload-video {
    flex: 0 0 auto;
    max-width: none;
    display: flex;
}

.media-row.media-row-fixed-ratio .video-container {
    flex: 0 0 auto;
    max-width: none;
}

.media-row.media-row-fixed-ratio .video-container .video-aspect-wrapper {
    height: 100%;
}

/* ============================================
   IMAGE STYLES
   ============================================ */
.image-container {
    margin: 10px 0;
}

.image-container.image-float-left {
    float: left;
    max-width: 45%;
    margin: 0 20px 15px 0;
}

.image-container.image-float-right {
    float: right;
    max-width: 45%;
    margin: 0 0 15px 20px;
}

.image-container.image-in-row {
    flex: 1;
    min-width: 150px;
}

.media-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* ============================================
   CONTENT UPLOAD STYLES
   ============================================ */
.content-upload-image {
    text-align: center;
}

/* Optional thin border for normal images via <abcd!> */
.content-upload-image.image-bordered img {
    border: 1px solid #b0b8c0;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Zoomable Maps-style image container via <abcd+> */
.content-upload-image.zoomable-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 2px solid #6c757d;
    border-radius: 6px;
    background: #1a1a1a;
    cursor: grab;
    margin-left: auto;
    margin-right: auto;
    /* aspect-ratio is set inline by JS from data-aspect-w/h, with naturalWidth fallback */
}
.content-upload-image.zoomable-image:active {
    cursor: grabbing;
}
.content-upload-image.zoomable-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    transform-origin: 0 0;
    border-radius: 0;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
.zoom-hint {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transition: opacity 150ms ease-out;
}
.content-upload-image.zoomable-image:hover .zoom-hint {
    opacity: 0;
}

.content-upload-video {
    margin: 15px 0;
}

.content-upload-download {
    margin: 10px 0;
}

/* ============================================
   WIDE MODAL FOR MULTIPLE FIXED-RATIO VIDEOS
   Note: Dynamic width is now set via inline styles.
   These classes are kept as fallback only.
   ============================================ */
.modal.modal-wide .modal-dialog {
    max-width: 95vw;
    width: 95vw;
}

.modal.modal-extra-wide .modal-dialog {
    max-width: 98vw;
    width: 98vw;
}

/* ============================================
   CREDIT STYLES
   ============================================ */
.bonus-credit-inline {
    display: inline-block;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 8px 14px;
    margin: 8px 0;
    color: #f57c00;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.bonus-credit-inline i { color: #ffc107; margin-right: 4px; }
.bonus-credit-inline strong { color: #e65100; font-size: 1.1em; }
.bonus-credit-simple { color: #f57c00; font-weight: bold; }
.bonus-credit-simple i { color: #ffc107; margin-right: 2px; }

/* ============================================
   MARKDOWN STYLES
   ============================================ */
.parsed-content h4, .parsed-content h5, .parsed-content h6 {
    color: #3f51b5;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.parsed-content h4 { margin-top: 2rem; }

.parsed-content hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #ddd;
}

.parsed-content blockquote {
    font-style: italic;
    border-left: 3px solid #3f51b5;
    padding-left: 1rem;
    color: #666;
    margin: 1rem 0;
}

.parsed-content ul, .parsed-content ol {
    padding-left: 25px;
    margin-bottom: 1rem;
}

.parsed-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.parsed-content p {
    margin-bottom: 0.75rem;
}

/* Code Styles */
/* alt: schwarz
.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}
*/

.code-block {
    border: 1px solid #bb657a;
    color: #f8f8f2;
    padding: 1rem 1.25rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #a71b3e;/* #c7254e; */
    font-weight: bold;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}


.code-block code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.inline-code {
    border: 1px solid #bb657a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #a71b3e;/* #c7254e; */
    font-weight: bold;
    font-size: 0.9em;
}

/* Keyboard combo: {key:strg+v} renders as <span class="kb-combo">…<kbd class="kb-key">…</kbd>…</span> */
.kb-combo {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
    line-height: 1;
}
.kb-key {
    display: inline-block;
    background: #2b2b2b;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 9px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.3;
    box-shadow: 0 2px 0 #000, 0 3px 4px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}
.kb-key i { font-size: 0.95em; }
.kb-plus {
    color: #888;
    font-weight: bold;
    padding: 0 2px;
    user-select: none;
}

/* Clearfix */
.instruction-body::after, .task-description::after, .parsed-content::after {
    content: ""; display: table; clear: both;
}

.instruction-body ul li {
  margin-bottom: 1ex;
}

/* ============================================
   HIGHLIGHT STYLES
   ============================================ */

/* Block Highlight (!!!...!!!) */
/*
.block_highlight {
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}
*/
.block_highlight {
    border-left: 5px solid #ffc107; /* Dicker Strich links */
    background-color: #fffdf0; /* Ganz helles Gelb */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.15);
    padding: 10px 15px;
    margin-bottom: 1rem;
}

.block_highlight p {
    margin-bottom: 0.5rem;
}

.block_highlight p:last-child {
    margin-bottom: 0;
}

/* Inline Highlight (==...==) */
/*
.inline_highlight {
    background: #ffd75f;
    padding: 2px 2px;
    border-radius: 3px;
    font-weight: 500;
}
*/

.inline_highlight {
    background-color: #fee36c; /* Weniger grell als Standard-Gelb */
    padding: 0.1rem 0.4rem;
    margin-left: -0.4rem;
    border-radius: 4px;
    color: #000000;
    font-weight: 400;
}
