/* Organizer Management Styles */

.organizer-management {
    padding: 0;
    width: 100%;
    overflow: hidden;
    margin: 0;
    background: var(--bg-primary);
    box-sizing: border-box;
    height: 100%;
    min-height: calc(100vh - 80px); /* Account for header */
    display: flex;
    flex-direction: column;
}

/* Fix for the organizer management section alignment within dashboard */
#organizerManagement.dashboard-section,
#organizerManagementSection.dashboard-section {
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    height: calc(100vh - 60px); /* Account for header */
    overflow: hidden;
}

/* Override content-wrapper padding for organizer management */
#organizerManagement .content-wrapper,
#organizerManagement .content-body {
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure organizer management aligns properly with reduced global padding */
#organizerManagement {
    padding: 0;
    margin: 0;
}

/* Removed global content-wrapper rule that was affecting other sections */

/* Force dashboard section to fill height - only for organizer management */
#organizerManagementSection.dashboard-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#organizer-management-container {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Section Header */
.organizer-management .section-header {
    margin-bottom: 20px;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.organizer-management .section-header h2 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.organizer-management .section-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Section Actions */
.organizer-management .section-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 0 20px;
    flex-shrink: 0;
}

/* View Panels */
.organizer-management .view-panel {
    display: none !important;
}

.organizer-management .view-panel.active {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Ensure the organizer content takes full height */
.organizer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

/* Fix editor view specifically */
#organizer-editor-view {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#organizer-editor-view.active {
    display: flex;
}

/* Specific list view styling */
#organizer-list-view {
    padding: 0 20px 20px 20px;
}

#organizer-list-view.active {
    overflow: hidden; /* Let children handle scrolling */
    display: flex;
    flex-direction: column;
}

/* Filters */
.organizers-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.organizers-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}

.organizers-filters .filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

/* Table Styles */
#organizers-table-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 20px;
    height: 100%;
}

.organizers-table-container {
    overflow-x: auto;
    overflow-y: auto;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1 1 auto;
    min-height: 0;
    background: white;
    height: 100%;
}

.organizers-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.organizers-table th,
.organizers-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.organizers-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.organizers-table tbody tr:hover {
    background: #f8f9fa;
}

/* Organizer Info Styles */
.organizer-name {
    line-height: 1.4;
}

.organizer-contact {
    line-height: 1.6;
}

.organizer-contact div {
    margin-bottom: 2px;
}

.organizer-contact i {
    width: 16px;
    margin-right: 6px;
    color: #666;
}

.organizer-location {
    line-height: 1.4;
}

.organizer-representative {
    line-height: 1.4;
}

.organizer-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* No Organizers State */
.no-organizers {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-organizers i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-organizers h3 {
    margin: 15px 0 10px 0;
    color: #333;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner i {
    font-size: 2rem;
    margin-right: 10px;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.pagination-ellipsis {
    padding: 0 5px;
    color: #999;
}

/* Organizer Editor Styles */
.organizer-editor {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    position: relative;
    flex: 1;
}

/* Editor Layout */
.editor-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* Fix for flexbox children height calculation */
}

/* Editor Sidebar */
.editor-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    flex-shrink: 0;
}

.editor-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.editor-nav .nav-item {
    border-bottom: 1px solid #dee2e6;
}

.editor-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    gap: 8px;
}

.editor-nav .nav-link:hover {
    background-color: #e9ecef;
    color: #333;
}

.editor-nav .nav-item.active .nav-link {
    background-color: #007bff;
    color: white;
}

/* Editor Content */
.editor-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0; /* Important for flex child scrolling */
}

.organizer-editor .editor-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header .header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.organizer-editor .editor-header h3 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.organizer-form {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    margin: 0;
    text-align: left;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    box-sizing: border-box;
    min-height: 0; /* Essential for proper flex scrolling */
    height: 100%; /* Ensure it takes full height of parent */
    position: relative;
    max-width: 100%;
}

/* Add a pseudo-element to ensure bottom space is always preserved */
.form-sections::after {
    content: '';
    display: block;
    height: 40px;
    flex-shrink: 0;
}

.form-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #fafbfc;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}

.form-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    text-align: left;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-control.is-valid {
    border-color: #28a745;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.form-actions {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    background: white;
    flex-shrink: 0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    background: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #117a8b;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert i {
    margin-right: 10px;
}

.alert ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .organizer-management {
        padding: 15px;
    }
    
    .organizers-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .organizers-filters .filter-group {
        min-width: unset;
    }
    
    .organizers-table-container {
        font-size: 0.8rem;
    }
    
    .organizers-table th,
    .organizers-table td {
        padding: 8px 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .organizer-editor .editor-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}

/* Specific height rules for organizer management only */
#organizerManagementSection {
    height: calc(100vh - 60px);
}

#organizerManagementSection.active {
    display: flex !important;
    flex-direction: column;
}

#organizerManagementSection .organizer-management {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#organizerManagementSection .organizer-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#organizerManagementSection .view-panel.active {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    min-height: 0;
}

#organizerManagementSection #organizers-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#organizerManagementSection .organizers-table-container {
    height: 100%;
    overflow: auto;
}

/* Drag and Drop Styles for Organizer Editor */

/* Section header with drag handle */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.section-drag-handle {
    opacity: 0;
    cursor: grab;
    color: #6c757d;
    transition: opacity 0.2s ease;
    padding: 5px;
    border-radius: 3px;
    margin-right: 5px;
}

.section-drag-handle:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.section-drag-handle:active {
    cursor: grabbing;
}

/* Show drag handles in reorder mode */
.organizer-editor.reorder-mode .section-drag-handle {
    opacity: 1;
}

/* Navigation drag handles */
.nav-drag-handle {
    opacity: 0;
    margin-left: auto;
    color: #6c757d;
    transition: opacity 0.2s ease;
    cursor: grab;
    padding: 3px;
}

.nav-drag-handle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.organizer-editor.reorder-mode .nav-drag-handle {
    opacity: 1;
}

/* Draggable section styles */
.draggable-section {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    border-radius: 8px;
    position: relative;
}

.draggable-section[draggable="true"] {
    cursor: move;
}

.draggable-section.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(0.98);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    pointer-events: none;
}

.draggable-section:not(.dragging) {
    transform: none;
}

/* Navigation item drag styles */
.nav-item[draggable="true"] {
    cursor: move;
}

.nav-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    background-color: rgba(0, 123, 255, 0.1);
}

/* Drop indicator */
.drop-indicator {
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    margin: 10px 0;
    position: relative;
    animation: pulse 1.5s infinite;
}

.drop-indicator .drop-line {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Form sections container for drag and drop */
.form-sections {
    position: relative;
}

.organizer-editor.reorder-mode .form-sections {
    min-height: 200px;
}

/* Reorder mode visual indicators */
.organizer-editor.reorder-mode {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.organizer-editor.reorder-mode .form-section {
    border: 2px dashed #dee2e6;
    background: rgba(255, 255, 255, 0.9);
}

.organizer-editor.reorder-mode .form-section:hover {
    border-color: #007bff;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

/* Disable form interactions during reorder mode */
.organizer-editor.reorder-mode .form-control,
.organizer-editor.reorder-mode .form-select,
.organizer-editor.reorder-mode textarea {
    pointer-events: none;
    opacity: 0.6;
}

/* Ensure drag handles always work in reorder mode */
.organizer-editor.reorder-mode .section-drag-handle,
.organizer-editor.reorder-mode .nav-drag-handle {
    pointer-events: auto !important;
    cursor: grab !important;
}

.organizer-editor.reorder-mode .section-drag-handle:active,
.organizer-editor.reorder-mode .nav-drag-handle:active {
    cursor: grabbing !important;
}

.organizer-editor.reorder-mode .form-group {
    user-select: none;
}

/* Navigation reorder styles */
.organizer-editor.reorder-mode .nav-item {
    border: 1px solid #dee2e6;
    margin: 2px 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.organizer-editor.reorder-mode .nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #007bff;
}

/* Reorder button states */
.editor-reorder {
    position: relative;
    overflow: hidden;
}

.editor-reorder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.editor-reorder:hover::before {
    left: 100%;
}

/* Improved visual feedback for drag over states */
.form-sections.drag-over {
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
}

.nav-sections.drag-over {
    background: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
}

/* Prevent text selection during drag */
.organizer-editor.reorder-mode * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Mobile responsive drag handles */
@media (max-width: 768px) {
    .section-drag-handle,
    .nav-drag-handle {
        opacity: 1; /* Always show on mobile */
        font-size: 1.2em;
    }
    
    .drop-indicator .drop-line {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* Bank Account Forms */
.bank-account-form {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
    max-width: none; /* Ensure no max-width restriction */
}

.bank-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bank-account-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.bank-account-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bank-account-actions .form-check {
    margin: 0;
}

.bank-account-actions .form-check-input {
    margin-right: 5px;
}

#bank-accounts-container {
    width: 100%;
    box-sizing: border-box;
    max-width: none;
    overflow: visible; /* Ensure no scrolling within container */
}

/* Ensure bank form fields use full width */
.bank-account-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.bank-account-form .form-group {
    margin-bottom: 0;
}

.bank-account-form .form-control {
    width: 100%;
}

/* Ensure bank accounts section uses full width */
.form-section.bank-accounts-section {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Bank accounts container should not have any sidebar-like restrictions */
.bank-accounts-section #bank-accounts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* Dark mode support */
.dark-mode .bank-account-form {
    background-color: #2d3142;
    border-color: #444;
}

.dark-mode .bank-account-form input,
.dark-mode .bank-account-form select,
.dark-mode .bank-account-form textarea {
    background-color: #1a1d2e;
    border-color: #444;
    color: #fff;
}