/* ========================================
   RUNDOWN REDESIGN - MODERN UI
   ======================================== */

/* Note: CSS Variables ada di base/_variables.css */

/* ========================================
   ASCII TABLE STYLES - Rundown Redesign
   ======================================== */
.ascii-table {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.ascii-table th,
.ascii-table td {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.ascii-table tbody tr {
    border-bottom: 1px solid #2c363f;
}

.ascii-table tbody tr:hover .delete-rundown-row {
    opacity: 1 !important;
}

/* ========================================
   RUNDOWN CONTAINER - GLASSMORPHISM
   ======================================== */
.rundown-container {
    background: var(--rundown-bg);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   RUNDOWN HEADER - PREMIUM GLASS EFFECT
   ======================================== */
.rundown-header {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.rundown-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
}

.rundown-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f1f5f9 0%, #a5b4fc 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

/* ========================================
   SEARCH AND FILTER BAR - MODERN GLASS
   ======================================== */
.rundown-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--glass-border);
}

.rundown-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.rundown-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--rundown-text);
    font-size: 0.875rem;
    transition: var(--rundown-transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rundown-search input::placeholder {
    color: var(--rundown-text-muted);
}

.rundown-search input:focus {
    outline: none;
    border-color: var(--rundown-accent);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(30, 41, 59, 0.95);
}

.rundown-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rundown-text-muted);
    pointer-events: none;
    transition: var(--rundown-transition);
}

.rundown-search input:focus+.search-icon,
.rundown-search:focus-within .search-icon {
    color: var(--rundown-accent);
}

.rundown-filter select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--rundown-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--rundown-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
}

.rundown-filter select:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.rundown-filter select:focus {
    outline: none;
    border-color: var(--rundown-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ========================================
   TOTAL DURATION DISPLAY - GLOWING BADGE
   ======================================== */
.rundown-duration {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(79, 70, 229, 0.9) 100%);
    border-radius: 0.75rem;
    font-weight: 600;
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.rundown-duration::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

.rundown-duration .duration-value {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* ========================================
   TABLE IMPROVEMENTS - PREMIUM LOOK
   ======================================== */
.rundown-table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 340px);
    scrollbar-width: thin;
    scrollbar-color: var(--rundown-accent) transparent;
}

.rundown-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    padding: 0 1rem;
}

/* Sticky Header - Glassmorphism */
.rundown-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.rundown-table thead th {
    background: #0f172a;
    padding: 1rem 0.875rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rundown-text-muted);
    border-bottom: 2px solid var(--rundown-accent);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--rundown-transition);
    user-select: none;
    position: relative;
}

.rundown-table thead th:first-child {
    border-radius: 0.5rem 0 0 0;
}

.rundown-table thead th:last-child {
    border-radius: 0 0.5rem 0 0;
}

.rundown-table thead th:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--rundown-text);
}

.rundown-table thead th .sort-icon {
    display: inline-block;
    margin-left: 0.375rem;
    opacity: 0.4;
    transition: var(--rundown-transition);
}

.rundown-table thead th:hover .sort-icon,
.rundown-table thead th.sorted .sort-icon {
    opacity: 1;
    color: var(--rundown-accent-light);
}

/* ========================================
   TABLE ROWS - CARD STYLE
   ======================================== */
.rundown-table tbody tr {
    transition: var(--rundown-transition);
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.75rem;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.rundown-table tbody tr:hover {
    background: var(--rundown-row-hover);
    box-shadow:
        0 8px 25px -5px rgba(99, 102, 241, 0.25),
        0 0 0 1px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px) scale(1.005);
}

.rundown-table tbody tr.editing {
    box-shadow:
        0 0 0 2px var(--rundown-accent),
        0 8px 25px -5px rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.15);
}

.rundown-table tbody td {
    padding: var(--rundown-row-spacing);
    vertical-align: middle;
    border: none;
}

.rundown-table tbody td:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
}

.rundown-table tbody td:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
}

/* Segment Name Column - Bold and Prominent */
.rundown-table td.segment-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rundown-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Time Columns - Monospace with Glow */
.rundown-table td.time-column {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
    font-size: 0.85rem;
    text-align: center;
    letter-spacing: 0.05em;
    color: var(--rundown-accent-light);
}

/* ========================================
   ROW TYPE COLORS - SUBTLE GRADIENT LEFT BORDER
   ======================================== */
.rundown-row-live {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%) !important;
    border-left: 4px solid #10b981 !important;
}

.rundown-row-recorded {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%) !important;
    border-left: 4px solid #f97316 !important;
}

.rundown-row-music {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%) !important;
    border-left: 4px solid #ec4899 !important;
}

.rundown-row-break {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%) !important;
    border-left: 4px solid #3b82f6 !important;
}

/* ========================================
   ROW ACTIONS - MODERN BUTTONS
   ======================================== */
.row-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--rundown-transition);
}

.rundown-table tbody tr:hover .row-actions {
    opacity: 1;
    transform: translateX(0);
}

/* Row action button styles ada di components/buttons.css */

/* ========================================
   TOAST NOTIFICATIONS - GLASSMORPHISM
   ======================================== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.875rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toast-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: var(--rundown-transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
}

.toast.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
}

/* ========================================
   ROW DRAG STATE
   ======================================== */
.rundown-table tbody tr.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.1) !important;
    box-shadow: 0 0 0 2px var(--rundown-accent);
}

.rundown-table tbody tr.drag-over {
    box-shadow: 0 -3px 0 0 var(--rundown-accent);
}

/* ========================================
   FOOTER - MODERN SUMMARY BAR
   ======================================== */
#panel-rundown>div>div:last-child {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    padding: 1.25rem 2rem;
}

#rundown-segment-count {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f1f5f9, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#rundown-diff {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--glass-border);
}

#rundown-diff.text-red-400 {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

#rundown-diff.text-blue-400 {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* ========================================
   TOOLBAR GROUP (Rundown Specific)
   ======================================== */
.toolbar-group {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.375rem;
}

/* ========================================
   COLOR PALETTE DROPDOWN
   ======================================== */
#color-palette {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 0.875rem;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
    padding: 0.875rem;
}

#color-grid>div {
    border-radius: 0.375rem;
    transition: var(--rundown-transition);
}

#color-grid>div:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}