* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.header-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.conflict-gap-setting {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 6px;
}

.conflict-gap-setting label {
    font-weight: 600;
    font-size: 14px;
}

.conflict-gap-setting input {
    width: 50px;
    padding: 6px;
    border: 2px solid white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.conflict-gap-setting .tooltip {
    font-size: 11px;
    opacity: 0.9;
    font-style: italic;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.btn-success {
    background: #FF9800;
    color: white;
}

.btn-success:hover {
    background: #e68900;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.btn-light {
    background: #ffffff;
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-light:hover {
    background: #f5f5f5;
}

.main-content {
    display: flex;
    height: calc(100vh - 140px);
    min-height: 600px;
}

/* Left Sidebar: Classes */
.sidebar {
    width: 280px;
    border-right: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.sidebar h2 {
    padding: 20px;
    background: #667eea;
    color: white;
    font-size: 18px;
}

.search-box {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.class-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.class-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s;
}

.class-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.class-item.dragging {
    opacity: 0.6;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.class-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.class-info {
    font-size: 12px;
    color: #666;
}

.class-badges {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.show-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Shows Container */
.shows-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fafafa;
}

.show-column {
    min-width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.show-header {
    background: #764ba2;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.show-title {
    font-size: 18px;
    font-weight: 600;
    outline: none;
    border: none;
    background: transparent;
    color: white;
}

.show-title:focus {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 4px;
}

.btn-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.show-dropzone {
    flex: 1;
    min-height: 400px;
    padding: 15px;
    overflow-y: auto;
}

.show-dropzone.drag-over {
    background: #e3f2fd;
    border: 2px dashed #2196F3;
}

/* Drag insertion placeholder */
.drop-placeholder {
        height: 42px;
        margin: 6px 0;
        border: 2px dashed #667eea;
        border-radius: 8px;
        background: rgba(102,126,234,0.08);
        animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0% { background: rgba(102,126,234,0.08); }
    50% { background: rgba(102,126,234,0.18); }
    100% { background: rgba(102,126,234,0.08); }
}

.assigned-class {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 12px;
    padding-left: 45px;
    margin-bottom: 10px;
    position: relative;
    cursor: move;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.assigned-class.dragging {
    opacity: 0.6;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.assigned-class .routine-number {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: bold;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assigned-class.costume-conflict {
    border: 3px solid #ff5252;
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

.assigned-class .costume-warning {
    background: #ff5252;
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    margin-top: 5px;
    font-weight: 600;
}

.assigned-class .class-name {
    color: white;
}

.assigned-class .class-info {
    color: rgba(255, 255, 255, 0.8);
}

.assigned-class .remove-from-show {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.assigned-class .remove-from-show:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.meta-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.chip {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    font-size: 11px;
    padding: 2px 8px;
}

.chip.warning-chip {
    background: #ff9800;
    color: white;
    border-color: #f57c00;
    font-weight: 600;
}

.class-item .chip {
    background: #eef2ff;
    color: #3949ab;
    border-color: #c5cae9;
}

.class-item .chip.warning-chip {
    background: #ff9800;
    color: white;
    border-color: #f57c00;
}

/* Right Sidebar: Conflicts */
.conflicts-panel {
    width: 320px;
    border-left: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background: #fff3e0;
}

.conflicts-panel h2 {
    padding: 20px;
    background: #f44336;
    color: white;
    font-size: 18px;
}

.conflicts-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.conflict-item {
    background: white;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.conflict-item.costume-change-conflict {
    border-left-color: #FF9800;
    background: #fff3e0;
}

.conflict-type {
    font-weight: 600;
    color: #f44336;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.conflict-item.costume-change-conflict .conflict-type {
    color: #FF9800;
}

.conflict-details {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.conflict-shows {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #999;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 1200px) {
    .conflicts-panel {
        width: 280px;
    }
    
    .sidebar {
        width: 240px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: min(640px, 92vw);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #764ba2;
    color: white;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-row label {
    font-size: 13px;
    font-weight: 600;
}

.form-row input[type="text"],
.form-row select,
.form-row textarea {
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    resize: vertical;
}

.image-preview img {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* Choreographers list styling */
#choreographersList {
    margin-top: 10px;
}

.choreo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.choreo-row .left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choreo-row .left .email {
    font-size: 12px;
    color: #666;
}

.choreo-row .actions {
    display: flex;
    gap: 6px;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar,
    .conflicts-panel {
        width: 100%;
        border: none;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .shows-container {
        flex-wrap: wrap;
    }
}
