/**
 * Worship Presentation System Styles
 *
 * Styles for the control screen layout.
 * Presentation screen styles are inline in presentation.blade.php.
 */

/* Main Container */
.worship-container {
    height: calc(100vh - 64px); /* Subtract header height */
    min-height: 500px;
}

/* Schedule List Items */
#schedule-list .schedule-item {
    transition: all 0.2s ease;
}

#schedule-list .schedule-item:hover {
    transform: translateX(2px);
}

#schedule-list .schedule-item.active {
    border-left: 3px solid hsl(var(--p));
}

/* Lyrics Display */
#lyrics-display .lyrics-line {
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

#lyrics-display .lyrics-line:hover {
    background-color: hsl(var(--b2));
}

#lyrics-display .lyrics-line.active {
    background-color: hsl(var(--p));
    color: hsl(var(--pc));
    border-left-color: hsl(var(--p));
}

/* Search Results */
#search-results .card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Preview Container */
#preview-container {
    aspect-ratio: 16 / 9;
    min-height: 120px;
    overflow: hidden;
}

#preview-content {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Style Modal Backgrounds Grid */
.backgrounds-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.backgrounds-grid .bg-item {
    aspect-ratio: 16 / 9;
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.backgrounds-grid .bg-item:hover {
    border-color: hsl(var(--p));
    transform: scale(1.05);
}

.backgrounds-grid .bg-item.selected {
    border-color: hsl(var(--p));
    box-shadow: 0 0 0 2px hsl(var(--p) / 0.3);
}

.backgrounds-grid .bg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Toast Notifications */
.alert.fixed {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Keyboard Shortcuts Hint */
.keyboard-shortcuts {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    padding: 0.75rem 1rem;
    background: hsl(var(--b2));
    border-radius: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.keyboard-shortcuts:hover {
    opacity: 1;
}

.keyboard-shortcuts kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: hsl(var(--b3));
    border-radius: 0.25rem;
    font-family: monospace;
    margin: 0 0.125rem;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading state for search */
#search-results .loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

/* Empty state styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: hsl(var(--bc) / 0.5);
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .worship-container {
        height: auto;
        min-height: calc(100vh - 64px);
    }

    .worship-container > .flex {
        flex-direction: column;
    }

    .worship-container > .flex > div {
        width: 100% !important;
        max-height: 50vh;
    }
}

/* Print styles - hide for printing */
@media print {
    .worship-container {
        display: none;
    }
}

/* ========================================
   Resizable Panels / Splitters
   ======================================== */

/* Splitter base styles */
.resizable-splitter {
    flex-shrink: 0;
    background: hsl(var(--b3));
    transition: background-color 0.15s ease;
    position: relative;
    z-index: 10;
}

.resizable-splitter:hover {
    background: hsl(var(--p) / 0.3);
}

.resizable-splitter.dragging {
    background: hsl(var(--p) / 0.5);
}

/* Horizontal splitter (left/right resize) */
.splitter-horizontal {
    width: 6px;
    cursor: col-resize;
    min-height: 100%;
}

.splitter-horizontal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 30px;
    background: hsl(var(--bc) / 0.2);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.splitter-horizontal:hover::before,
.splitter-horizontal.dragging::before {
    height: 50px;
    background: hsl(var(--p) / 0.5);
}

/* Vertical splitter (top/bottom resize) */
.splitter-vertical {
    height: 6px;
    cursor: row-resize;
    width: 100%;
}

.splitter-vertical::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 2px;
    background: hsl(var(--bc) / 0.2);
    border-radius: 2px;
    transition: width 0.15s ease;
}

.splitter-vertical:hover::before,
.splitter-vertical.dragging::before {
    width: 50px;
    background: hsl(var(--p) / 0.5);
}

/* Body state during resize */
body.resizing {
    user-select: none;
    -webkit-user-select: none;
}

body.resizing * {
    cursor: inherit !important;
}

/* Resizable panel containers */
.resizable-row {
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.resizable-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.resizable-panel {
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* Double-click hint tooltip */
.resizable-splitter[title] {
    position: relative;
}

/* Splitter grip dots for better visual feedback */
.splitter-horizontal::after {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: hsl(var(--bc) / 0.3);
    font-size: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.splitter-horizontal:hover::after {
    opacity: 1;
}

.splitter-vertical::after {
    content: '⋯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: hsl(var(--bc) / 0.3);
    font-size: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.splitter-vertical:hover::after {
    opacity: 1;
}
