/* Admin Panel Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: #1f2937;
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #374151;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: #d1d5db;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #374151;
    color: white;
}

.nav-item.active {
    background: #3b82f6;
    color: white;
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
}

.nav-label {
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #374151;
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Table container */
.admin-section .data-table {
    margin-right: auto;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Search and Controls */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.advanced-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.filter-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #374151;
}

.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-controls {
    display: flex;
    gap: 10px;
}

/* Sections */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

/* Data Table */
.data-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.data-table table {
    width: auto;
    min-width: 600px;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

/* Compact the checkbox header cell */
.data-table th.checkbox-col {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0 2px !important;
    text-align: center;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Column widths - Fixed widths to prevent crushing */
.checkbox-col {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0 2px !important;
}

.col-name {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.col-wins-count {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.col-media-count {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.col-most-recent-win {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.col-email {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

.col-join-date {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.col-gender {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.col-bio {
    width: 400px;
    min-width: 400px;
    max-width: 400px;
}

.col-linkedin {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

/* Loading state */
.loading {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 40px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.close-btn:hover {
    color: #374151;
}

.modal-body {
    padding: 20px;
}

/* Modern Modal Styles */
.modal-content.modern-modal {
    max-width: 700px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.modern-modal .modal-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    flex: 1;
}

.modal-title h3 {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.modal-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

.modern-modal .close-btn {
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-modal .close-btn:hover {
    background: #f3f4f6;
}

.modern-modal .modal-body {
    padding: 32px;
    background: #ffffff;
}

/* Modern Form Styles */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.required-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Searchable Select Styles */
.searchable-select-container {
    position: relative;
}

.searchable-select-container input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.searchable-select-container input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.coach-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.coach-option:hover {
    background-color: #f8fafc;
}

.coach-option:last-child {
    border-bottom: none;
}

.coach-option.selected {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.selected-coach {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    margin-top: 8px;
}

.coach-name {
    font-weight: 500;
    color: #0c4a6e;
}

.clear-selection {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-selection:hover {
    color: #374151;
    background: #f3f4f6;
}

/* File Upload Area */
.file-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    pointer-events: none;
}

.file-upload-content svg {
    color: #9ca3af;
    margin-bottom: 8px;
}

.file-upload-content p {
    margin: 0 0 4px 0;
    color: #374151;
    font-weight: 500;
}

.file-upload-content small {
    color: #6b7280;
    font-size: 12px;
}

/* Modern Modal Footer */
.modern-modal .modal-footer {
    padding: 24px 32px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modern-modal .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.modern-modal .btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.modern-modal .btn-secondary:hover {
    background: #e5e7eb;
}

.modern-modal .btn-primary {
    background: #3b82f6;
    color: white;
}

.modern-modal .btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.column-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.column-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.column-options label:hover {
    background: #f3f4f6;
}

.column-options input[type="checkbox"] {
    margin-right: 8px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-controls {
        justify-content: center;
    }
}

/* Win Content Display Styles */
.win-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 14px;
}

.win-category {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 6px;
}

.win-description {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Select All Checkbox Styles */
.select-all-checkbox {
    transform: scale(1.0);
    cursor: pointer;
}

.checkbox-col {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}

.checkbox-col input[type="checkbox"] {
    cursor: pointer;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 20px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bulk-actions-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.selected-count {
    font-weight: 600;
    color: #92400e;
}

.bulk-actions-buttons {
    display: flex;
    gap: 10px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* CSV Import Modal Styles */
.import-instructions {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.import-instructions h4 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 16px;
}

.import-instructions p {
    margin: 0 0 10px 0;
    color: #6b7280;
}

.import-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.import-instructions li {
    margin-bottom: 5px;
    color: #4b5563;
}

.file-upload-area {
    margin-bottom: 20px;
}

.file-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-drop-zone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.file-drop-zone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-zone-icon {
    font-size: 48px;
    color: #6b7280;
}

.drop-zone-content p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.selected-file {
    background: #d1fae5;
    border: 1px solid #10b981;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    color: #065f46;
    font-weight: 500;
}

.import-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.import-preview h4 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 16px;
}

#previewTable {
    overflow-x: auto;
}

#previewTable table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

#previewTable th,
#previewTable td {
    border: 1px solid #e2e8f0;
    padding: 8px;
    text-align: left;
}

#previewTable th {
    background: #f1f5f9;
    font-weight: 600;
    color: #374151;
}

#previewTable td {
    color: #6b7280;
}

/* Settings section styles */
.settings-content {
    padding: 20px;
}

.settings-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.settings-group h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 18px;
}

.settings-description {
    margin: 10px 0 0 0;
    color: #6b7280;
    font-size: 14px;
}

/* Group header styles */
.group-header {
    background-color: #fafbfc !important;
    border-top: 1px solid #e5e7eb !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.group-header:not(:first-child) {
    margin-top: 32px !important;
}

.group-header td:not(.checkbox-col) {
    padding: 12px 20px 12px 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #4b5563 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: none !important;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    white-space: nowrap;
    width: 100%;
}

.group-header td.checkbox-col {
    padding: 0 2px !important;
    border-bottom: none !important;
}

.group-header:hover {
    background-color: #f1f5f9 !important;
}

/* Expand/collapse icon */
.group-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #9ca3af;
}

.group-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

/* Collapsed group rows */
.group-content.collapsed {
    display: none;
}

/* Group spacer rows */
.group-spacer {
    height: 24px !important;
    background: transparent !important;
    border: none !important;
}

.group-spacer td {
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
}

.group-spacer.collapsed {
    display: none;
}

/* Wins table column styles */
.col-coach {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.col-title {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.col-category {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.col-description {
    width: 400px;
    min-width: 400px;
    max-width: 400px;
}

.col-date {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.col-created {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

/* Media preview column */
.col-preview {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.media-preview-thumb {
    width: 64px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
}

/* Media table specific columns */
.media-table .col-coach {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

/* Group by modal styles */
.group-options label {
    display: block;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.group-options label:hover {
    background-color: #f3f4f6;
}

.group-options input[type="radio"] {
    margin-right: 8px;
}

/* Modern Modal Enhancements */
.modal-content {
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.win-option:hover {
    background-color: #f3f4f6 !important;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.file-upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.02);
}

.data-table td.checkbox-col {
    padding: 0 2px !important;
}