body {
    font-family: sans-serif;
    display: block;
    background-color: #f0f0f0;
    margin: 0;
}

.site-header {
    background: #1a1a1a;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-logo:hover {
    opacity: 0.9;
}

.logo-icon {
    background: #2196F3;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.logo-text {
    background: linear-gradient(45deg, #fff 30%, #2196F3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#app {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

#player, #overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#overlay-layer {
    pointer-events: none; /* Let clicks pass through to video unless on an element */
    z-index: 10;
}

.interaction-element {
    position: absolute;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    pointer-events: auto; /* Enable clicks on interactions */
    transition: transform 0.2s;
}

.interaction-element:hover {
    transform: scale(1.05);
    background: white;
}
.controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#seek-bar {
    width: 100%;
    cursor: pointer;
}

/* Interaction Styles */
.interaction-element.type-text {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    pointer-events: none; /* Text boxes usually aren't clickable unless specified */
}

.interaction-element.type-hotspot {
    background: rgba(0, 123, 255, 0.2); /* Semi-transparent in editor */
    border: 1px dashed #007bff;
}

/* Hide hotspot styling in the actual player */
body:not(.editor-mode) .interaction-element.type-hotspot {
    background: transparent;
    border: none;
}

/* Advanced Layered Timeline */
.scrubber-container {
    position: relative;
    width: 100%;
    background: #f0f0f0;
    margin: 20px 0;
    border-radius: 4px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
}

.timeline-header {
    height: 30px;
    background: #ddd;
    position: relative;
    border-bottom: 1px solid #bbb;
}

.timeline-body {
    max-height: 250px;
    overflow-y: auto;
    background: #f9f9f9;
    position: relative;
    min-height: 100px;
}

#seek-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0; /* Fully invisible, just for input */
    z-index: 10;
    cursor: pointer;
}

.playhead-visual {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: red;
    z-index: 9;
    pointer-events: none;
}

.timeline-layer {
    height: 35px;
    width: 100%;
    border-bottom: 1px solid #eee;
    position: relative;
    display: flex;
    align-items: center;
}

.timeline-block {
    position: absolute;
    height: 24px;
    background: rgba(33, 150, 243, 0.7);
    border: 1px solid #1976D2;
    border-radius: 3px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 5px;
    z-index: 5;
}

.timeline-block.active {
    background: #1976D2;
    border: 2px solid #000;
}

.resize-handle {
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    background: rgba(0,0,0,0.1);
    cursor: ew-resize;
}

.resize-handle-left { left: 0; }
.resize-handle-right { right: 0; }

.resize-handle:hover {
    background: rgba(0,0,0,0.3);
}

.marker-ts {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(76, 175, 80, 0.4);
    border-left: 1px solid #4CAF50;
    z-index: 2;
}

.marker-label {
    position: absolute;
    top: 5px;
    left: 4px;
    font-size: 10px;
    white-space: nowrap;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    display: block;
    pointer-events: auto; /* Enable for dragging */
    cursor: move;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.marker-ts:hover {
    background: rgba(76, 175, 80, 0.6);
}

.marker {
    position: absolute;
    pointer-events: none;
    z-index: 100;
}

.raw-seconds {
    color: #666;
    font-size: 0.8em;
    margin-left: 5px;
}

body.snap-active {
    cursor: copy !important; /* Visual cue that we are snapping to something */
}

/* Editor Layout Update */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 400px; /* Wider sidebar for more controls */
    gap: 20px;
}

.interaction-editor-compact {
    background: white;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.interaction-editor-compact h3 {
    font-size: 1.1rem;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #333;
    background: #fdfdfd;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: white;
}

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

.form-row > div {
    flex: 1;
}

.time-range-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-range-group span {
    color: #999;
    font-size: 0.8rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    text-transform: none;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.editor-actions button {
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

#save-interaction-btn {
    flex: 2;
    background: #2196F3;
    color: white;
}

#save-interaction-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

#cancel-interaction-btn {
    flex: 1;
    background: #f1f1f1;
    color: #666;
}

#cancel-interaction-btn:hover {
    background: #e4e4e4;
}

/* Modern List Item Blocks */
.timestamp-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.timestamp-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.timestamp-item:hover {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
    transform: translateY(-1px);
}

.timestamp-item span {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    flex: 1;
}

.timestamp-item .time-tag {
    background: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
    margin-right: 15px;
}

.timestamp-item button {
    background: #ffeded;
    color: #f44336;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.timestamp-item button:hover {
    background: #f44336;
    color: white;
}

.timestamp-item button.btn-edit-small {
    background: #e3f2fd;
    color: #2196F3;
}

.timestamp-item button.btn-edit-small:hover {
    background: #2196F3;
    color: white;
}
