/* Exhibitor Detail Window - Window Content Styles */

.exhibitor-detail-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: visible; /* Let parent handle scrolling */
    min-height: 0; /* Important for flex child overflow */
    padding: 10px; /* Add padding here instead of window-content */
}

/* Dark mode support for exhibitor detail content */
body.dark-mode .exhibitor-detail-content {
    background: var(--card-bg, #1e1e1e);
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .window-header-controls {
    background: var(--bg-secondary, #252525);
    border-bottom-color: var(--border-color, #333333);
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .window-footer {
    background: var(--bg-secondary, #252525);
    border-top-color: var(--border-color, #333333);
    color: var(--text-primary, #e0e0e0);
}

/* Window Header Controls */
.window-header-controls {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin: -10px -10px 10px -10px; /* Negative margin to extend to edges */
    gap: 15px; /* Add space between sections */
}

.title-section {
    flex: 1;
}

.title-section h4 {
    color: #495057;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-section {
    display: flex;
    align-items: center;
}

.status-section .form-select {
    min-width: 160px;
    font-size: 0.875rem;
}

.control-buttons {
    display: flex;
    gap: 8px;
}

.control-buttons .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Window Body */
.window-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Let parent handle scrolling */
    padding: 0; /* Remove extra padding since parent now has padding */
    min-height: 0; /* Important for flex child overflow */
    width: 100%; /* Ensure full width */
    height: 100%; /* Ensure full height */
    position: relative; /* Ensure proper positioning context */
}

/* Tab Navigation */
.nav-tabs {
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
    flex-shrink: 0;
}

.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.05);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background: white;
    border-bottom-color: #0d6efd;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: visible; /* Let parent handle scrolling */
    padding: 20px 0;
    min-height: 0; /* Important for flex child overflow */
    display: flex; /* Add flex display */
    flex-direction: column; /* Ensure proper layout */
    width: 100%; /* Ensure full width */
    position: relative; /* Ensure proper positioning context */
}

/* Ensure tab panes take full space */
.tab-pane {
    flex: 1;
    display: flex !important; /* Override Bootstrap's display: none */
    flex-direction: column;
    min-height: 0;
}

.tab-pane:not(.active) {
    display: none !important; /* Hide inactive tabs */
}

.tab-pane.active {
    display: flex !important; /* Show active tab with flex */
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:read-only {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

.form-control:disabled {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

.form-check {
    margin-top: 1rem;
}

.form-check-input:disabled {
    opacity: 0.6;
}

/* Communication Tab */
.communication-tab h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

#communication-list {
    max-height: 300px;
    overflow-y: auto;
}

.add-note-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Window Footer */
.window-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 12px 10px;
    flex-shrink: 0;
    margin: 10px -10px -10px -10px; /* Negative margin to extend to edges */
}

.status-info {
    font-size: 0.875rem;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background: #157347;
    border-color: #146c43;
}

.btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5c636a;
    border-color: #565e64;
}

.btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

/* VIP Badge */
.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .exhibitor-detail-content {
        padding: 8px; /* Reduced padding for mobile */
    }
    
    .window-header-controls {
        padding: 12px 8px;
        margin: -8px -8px 8px -8px;
        flex-direction: column;
        gap: 12px;
    }
    
    .title-section {
        text-align: center;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 16px 0;
    }
    
    .window-footer {
        padding: 12px 8px;
        margin: 8px -8px -8px -8px;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
.nav-link:focus,
.btn:focus,
.form-control:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Ensure scrollbar works on exhibitor detail window */
.editor-window .window-content {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fix window dimensions for exhibitor detail */
#window-exhibitor-detail .window-content {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

#window-exhibitor-detail .exhibitor-detail-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Enhanced Scrollbar Styling */
.tab-content::-webkit-scrollbar,
#communication-list::-webkit-scrollbar,
.exhibitor-detail-content::-webkit-scrollbar,
#window-exhibitor-detail .window-content::-webkit-scrollbar {
    width: 12px;
}

.tab-content::-webkit-scrollbar-track,
#communication-list::-webkit-scrollbar-track,
.exhibitor-detail-content::-webkit-scrollbar-track,
#window-exhibitor-detail .window-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.tab-content::-webkit-scrollbar-thumb,
#communication-list::-webkit-scrollbar-thumb,
.exhibitor-detail-content::-webkit-scrollbar-thumb,
#window-exhibitor-detail .window-content::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 6px;
    border: 2px solid #f8f9fa;
    min-height: 30px;
}

.tab-content::-webkit-scrollbar-thumb:hover,
#communication-list::-webkit-scrollbar-thumb:hover,
.exhibitor-detail-content::-webkit-scrollbar-thumb:hover,
#window-exhibitor-detail .window-content::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Firefox scrollbar styling */
.tab-content,
#communication-list,
.exhibitor-detail-content {
    scrollbar-width: thin;
    scrollbar-color: #007bff #f8f9fa;
}

/* Force scrollbar to always be visible */
.tab-content {
    overflow-y: scroll !important;
    scrollbar-gutter: stable; /* Reserve space for scrollbar */
}

/* Remove duplicate financial tab styles - they are in financial-tab.css */

/* Specific fix for financial tab pane */
#financial-tab {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: 400px;
}

#financial-tab:not(.active) {
    display: none !important;
}

/* Specific fix for contracts tab pane */
#contracts-tab {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 400px !important;
}

#contracts-tab:not(.active) {
    display: none !important;
}

/* When contracts tab is active, ensure everything is visible */
#contracts-tab.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#contracts-tab.active #contracts-tab-content {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#contracts-tab.active .contracts-tab-modern {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure contracts tab content is visible */
#contracts-tab-content {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Animations */
.exhibitor-detail-content {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clean spacing */
.mb-3:last-child {
    margin-bottom: 0 !important;
}

.row:last-child {
    margin-bottom: 0;
}

/* Tab Switching Fix - Prevent Overlapping */
/* Ensure tab content container has proper layout */
#tab-content {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Hide inactive tab panes properly */
#tab-content .tab-pane {
    display: none !important;
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
}

/* Show active tab pane */
#tab-content .tab-pane.active {
    display: flex !important;
    flex-direction: column;
}

/* Special handling for info tab to display as block */
#tab-content #info-tab.active {
    display: block !important;
}

/* Ensure communication tab displays properly */
#tab-content #communication-tab.active {
    display: block !important;
}

/* Clear any absolute positioning that might be lingering */
#tab-content .tab-pane {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: auto !important;
}

/* Only the active tab should be visible */
#tab-content .tab-pane:not(.active) {
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}