/* General Body & Layout */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
}

body:not(.sales-page-layout):not(.show-page-layout) {
    padding-top: 70px;
}

.centered-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
}

.success {
    background-color: #d4edda;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Main Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-left a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logout-link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

.primary-btn {
    background-color: #2563eb;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

/* ======================================================================== */
/* MODERN SHOW PAGE LAYOUT */
/* ======================================================================== */

body.show-page-layout {
    padding-top: 85px; /* Height of main-header */
    background-color: #fff;
    color: #111;
    overflow-x: hidden;
}

.show-page-layout .dashboard-container {
    padding: 0 2rem 2rem 2rem;
    max-width: 100%;
}

.show-page-layout .show-title-banner {
    padding: 2rem 0;
}

.show-page-layout .show-title-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
}

/* Global Search */
.global-search-container {
    background: #eceef2;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.06);
    padding: 1.2rem 1.5rem 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
    border: 1px solid #ececec;
    position: relative;
}

.global-search-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

#global-fixture-search {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-result-item:hover {
    background-color: #e7f5ff;
}

/* Fixture Form Container */
.show-page-layout .fixture-form-container {
    background: #eceef2;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.show-page-layout .fixture-form-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.show-page-layout .form-inline-group {
    /* This can be a flex container to better manage internal alignment */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligns label and input to the bottom */
}

.show-page-layout .form-inline-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    background-color: #e9ecef;
    cursor: not-allowed;
}

.show-page-layout .form-inline-group select,
.show-page-layout .form-inline-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    font-size: 0.9rem;
}

.show-page-layout .form-inline-group input[readonly] {
    cursor: not-allowed;
}

.suggestion-text {
    font-size: 0.9rem;
    color: #e53935;
    font-weight: 600;
    padding-top: 6px;
    min-height: 1.2em; /* Ensures space is reserved for the text */
}

/* Universe Container & Grid Layout */
.show-page-layout .universe-container {
    background: #eceef2;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

.show-page-layout .universe-header, .show-page-layout .universe-panel {
    background: #eceef2;
}

.show-page-layout .universe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.show-page-layout .universe-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.show-page-layout .toggle-button {
    background: none;
    border: 1px solid #ced4da;
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.show-page-layout .toggle-button:hover {
    background-color: #e9ecef;
}

.show-page-layout .universe-panel.collapsed .toggle-button {
    transform: rotate(45deg);
}

.show-page-layout .universe-panel.collapsed .universe-body {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

/* This is the main flex container for the Fixture List and DMX Grid */
.show-page-layout .universe-body {
    display: flex;
    align-items: stretch; /* Make children same height */
    background-color: #fff;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

/* Fixture List (Left Side) */
.show-page-layout .fixture-list-wrapper {
    flex: 1 1 40%; /* Flex-grow, flex-shrink, flex-basis */
    min-width: 400px;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column; /* Allows header/body structure */
}

.show-page-layout .fixture-list-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.show-page-layout .assignments-list-container {
    overflow-y: auto;
    max-height: 45rem;
    flex-grow: 0;
    flex-shrink: 1;
    scrollbar-width: thin;
    scrollbar-color: #2563eb #e9ecef;
    box-shadow: 4px 0 12px -8px #b0b0b0 inset;
    border-radius: 0 0 8px 8px;
    position: relative;
}
.show-page-layout .assignments-list-container:hover {
    overflow-y: scroll;
}

.show-page-layout .assignments-list-container::after {
    content: '';
    display: block;
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 32px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, #fff 100%);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.2s;
}
.show-page-layout .assignments-list-container.at-bottom::after {
    opacity: 0;
}

.show-page-layout .assignments-list-container::-webkit-scrollbar {
    width: 10px;
    background: #e9ecef;
}
.show-page-layout .assignments-list-container::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 8px;
}

.show-page-layout .universe-panel {
    margin-bottom: 2.5rem;
}

/* Clean Table-like Fixture List */
.show-page-layout .assignments-list {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.show-page-layout .assignments-list .list-header {
    display: table-header-group;
    font-weight: 600;
    color: #495057;
    background-color: #fdfdff;
}

.show-page-layout .assignments-list .list-row {
    display: table-row;
    border-bottom: 1px solid #222a4d;
    cursor: pointer;
    background-color: #001060;
    color: #f3f4f8;
}

.show-page-layout .assignments-list .list-row.highlighted,
.show-page-layout .assignments-list .list-row:hover {
    background-color: #1a237e;
    color: #fff;
}

.show-page-layout .assignments-list .list-cell {
    display: table-cell;
    padding: 0.85rem 1.5rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #f3f4f8;
}

.show-page-layout .delete-fixture-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.show-page-layout .delete-fixture-btn:hover {
    color: #f03e3e;
    background-color: #fff0f0;
}

/* DMX Grid (Right Side) */
.show-page-layout .dmx-grid-wrapper {
    flex: 1 1 60%;
    min-width: 512px; /* Ensure grid doesn't get too squished */
    display: flex;
    flex-direction: column;
}

.show-page-layout .dmx-grid-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.show-page-layout .dmx-grid-container {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.show-page-layout .dmx-grid {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 5px;
}

.show-page-layout .dmx-channel {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 10px;
    color: #f3f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    user-select: none;
    font-weight: bold;
    text-shadow: 0 1px 2px #000a;
}

.show-page-layout .dmx-channel.used {
    background-color: #ced4da;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px #000a;
}

/* Highlighting and Suggestions */
.dmx-channel.suggestion,
.dmx-channel.manual-slot,
.dmx-channel.conflict-slot {
    border-width: 2px;
    font-weight: bold;
    color: #fff !important;
    text-shadow: 0 1px 2px #000a;
}

.dmx-channel.suggestion {
    border-color: #fa5252;
    color: #fa5252;
    animation: flash-red-border 1s infinite;
}

.dmx-channel.manual-slot {
    border-color: #4dabf7;
    background-color: #d0ebff;
}

.dmx-channel.conflict-slot {
    border-color: #fa5252;
    color: #fa5252;
    background-color: #fff5f5;
    animation: flash-red-border 1s infinite;
}

@keyframes flash-red-border {
    50% { border-color: #ffc9c9; }
}

/* Media Queries for Responsiveness */
@media (max-width: 1200px) {
    .show-page-layout .universe-body {
        flex-direction: column;
        align-items: stretch;
    }
    .show-page-layout .fixture-list-wrapper {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        min-width: 100%;
        max-height: 400px; /* Give the list a max height when stacked */
    }
     .show-page-layout .dmx-grid-wrapper {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    body.show-page-layout {
        padding-top: 70px;
    }
    .main-header {
        padding: 0.5rem 1rem;
    }
    .show-page-layout .dashboard-container {
        padding: 0 1rem 1rem 1rem;
    }
    .show-page-layout .fixture-form-horizontal {
        grid-template-columns: 1fr; /* Stack form inputs */
    }
    .show-page-layout .dmx-grid {
        grid-template-columns: repeat(16, 1fr);
    }
}

.selected-fixture {
    border: 2px solid #28a745 !important;
    box-sizing: border-box;
    z-index: 2;
}
.selected-fixture.flash {
    animation: flash-green 0.6s 3;
}
@keyframes flash-green {
    0%   { box-shadow: 0 0 0 0 #28a745; }
    50%  { box-shadow: 0 0 10px 4px #28a745; }
    100% { box-shadow: 0 0 0 0 #28a745; }
}

.assignments-list .selected-fixture {
    border: 4px solid #0a7d2c !important;
    background: #eaffea !important;
    box-shadow: 0 0 12px 3px #1ec94c66;
    font-weight: bold;
}

.dmx-channel.grid-delete-preview {
    background-color: #ffdddd !important;
    border-color: #ff2222 !important;
    color: #b30000 !important;
    box-shadow: 0 0 6px 2px #ff222244;
    z-index: 3;
}

.show-page-layout .assignments-list .list-row,
.show-page-layout .assignments-list .list-cell {
    font-weight: bold;
    color: #222;
}

.show-page-layout .dmx-channel,
.show-page-layout .dmx-channel.used,
.dmx-channel.suggestion,
.dmx-channel.manual-slot,
.dmx-channel.conflict-slot {
    color: #222 !important;
    font-weight: bold;
    text-shadow: none;
} 