/* MTGO-DB Base Styles - Common styling for all pages */

/* Typography and Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #e5e7eb; /* neutral-300 */
    color: #333333;
    line-height: 1.5;
    font-size: 14px;
    padding-top: 72px; /* Account for fixed header */
}

/* Header Styles */
.unified-header {
    background-color: #0039A6;
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
    min-height: 72px;
    width: 100%;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 164px;
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: opacity 0.2s ease;
}

.header-brand:hover {
    text-decoration: none;
    color: white;
    opacity: 0.9;
}

.brand-icon {
    margin-right: 12px;
}

.brand-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    padding: 8px;
    margin-right: 12px;
    cursor: pointer;
    border-radius: 4px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-center {
    flex: 1;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.page-title {
    font-size: 24px !important;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    color: white !important;
    text-overflow: ellipsis;
}

.header-right {
    min-width: 164px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    font-size: 24px;
    margin-right: 8px;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-email {
    font-size: 14px;
    font-weight: 500;
}

.user-chevron {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    min-width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.user-dropdown-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 4px 0;
}

.nav-icon {
    margin-right: 12px;
    width: 16px;
    text-align: center;
    color: #666;
}

.nav-text {
    font-size: 14px;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-btn {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.login-btn {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.login-btn .nav-icon {
    color: white;
}

.login-btn:hover .nav-icon {
    color: white;
}

.register-btn {
    background-color: white;
    color: #0039A6;
    border: 1px solid white;
}

.register-btn:hover {
    background-color: #f8f9fa;
    color: #0039A6;
    text-decoration: none;
}

/* Layout Styles */
.app-layout {
    display: flex;
    min-height: calc(100vh - 72px);
    margin-top: 0; /* Remove any top margin since body now has padding-top */
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e9ecef;
    padding: 0;
    position: fixed;
    height: calc(100vh - 72px);
    left: 0;
    top: 72px;
    z-index: 999;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    transform: translateX(-82%);
}

/* Sidebar collapse button */
.sidebar-collapse-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.2s ease;
    z-index: 1000;
}

.sidebar-collapse-btn:hover {
    background: #e9ecef;
    color: #0039A6;
    border-color: #0039A6;
}

.sidebar-collapse-btn:active {
    transform: scale(0.95);
}

/* Adjust sidebar content to avoid overlap with collapse button */
.sidebar-content {
    padding: 24px 0;
}

/* Disabled sidebar button styling */
.sidebar .nav-link.disabled {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    color: #6c757d !important;
}

.sidebar .nav-link.disabled .nav-icon {
    color: #6c757d !important;
}

.sidebar .nav-link.disabled:hover {
    background-color: transparent !important;
}

/* Table-dependent buttons start disabled by default */
.sidebar .nav-link.table-dependent {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    color: #6c757d;
}

.sidebar .nav-link.table-dependent .nav-icon {
    color: #6c757d;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin: 0 24px 12px 24px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: #f8f9fa;
    color: #0039A6;
    border-left-color: #0039A6;
    text-decoration: none;
}

.nav-link.active {
    background-color: #e8f4fd;
    color: #0039A6;
    border-left-color: #0039A6;
    font-weight: 500;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 12px;
    min-width: 0;
}

/* Adjust main content when sidebar is collapsed - higher specificity */
.app-layout .sidebar.collapsed ~ .main-content {
    margin-left: calc(280px * 0.18) !important;
}

/* Container Styles */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0;
}

.content-wrapper {
    width: 100%;
}

/* Getting Started Page Container */
.getting-started-container {
    max-width: 1000px;
    width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.getting-started-container .card {
    margin-bottom: 20px;
}

.getting-started-container .card:last-child {
    margin-bottom: 0;
}

/* Ensure collapsible content has proper styling */
.getting-started-container .section-card-content {
    overflow: hidden;
}

/* Only enable transitions after JS has initialized (when body has 'js-loaded' class) */
body.js-loaded .getting-started-container .section-card-content {
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

.getting-started-container .section-card-content:not(.expanded) {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
}

.getting-started-container .section-card-content.expanded {
    max-height: none;
    opacity: 1;
    padding: 20px;
}

.section-intro {
    font-style: italic;
    color: black;
    margin-bottom: 20px;
    font-size: 16px;
}

.step {
    margin-bottom: 20px;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0039A6;
}

.step:last-child {
    margin-bottom: 0;
}

.step h4 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.step p {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.step a {
    color: #0039A6;
    text-decoration: none;
    font-weight: 600;
}

.step a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for getting started page */
@media (max-width: 1040px) {
    .getting-started-container {
        max-width: 95%;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .getting-started-container {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }
    
    .getting-started-container h2 {
        font-size: 20px;
    }
    
    .step h4 {
        font-size: 16px;
    }
    
    .step p {
        font-size: 14px;
    }
}

/* Section Styles */
/* Legacy section container (not used on new Home) */
.section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 24px;
    text-align: center;
}

.section-title {
    color: #0039A6;
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.section-subtitle {
    color: black;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #333;
    margin: 0 0 16px 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; color: #0039A6; border-bottom: 2px solid #0039A6; padding-bottom: 8px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #0039A6;
    box-shadow: 0 0 0 3px rgba(0, 57, 166, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* Form Groups and Input Containers */
.form-group,
.input-group,
.form-div {
    margin-bottom: 16px;
}

/* Add spacing to direct children divs in modal body that contain form elements */
.modal-body > div {
    margin-bottom: 16px;
}

/* Override for specific elements that shouldn't have bottom margin */
.modal-body > div:last-child {
    margin-bottom: 0;
}

/* Message boxes and alerts should retain their existing spacing */
.modal-body > .message-box {
    margin-bottom: 16px;
}

.modal-body > .alert {
    margin-bottom: 16px;
}

/* Remove bottom margin from last form element in modal */
.modal-body > .form-group:last-child,
.modal-body > .input-group:last-child,
.modal-body > .form-div:last-child {
    margin-bottom: 0;
}

/* Small messages/help text under form inputs */
.form-help,
.help-text,
.form-text,
.small-message {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    margin-bottom: 0;
}

/* Button Styles */
.button,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button.primary,
.btn-primary {
    background-color: #0039A6;
    color: white;
}

.button.primary:hover,
.btn-primary:hover {
    background-color: #002d7a;
    text-decoration: none;
    color: white;
}

.button.secondary,
.btn-secondary {
    background-color: #000000;
    color: white;
}

.button.secondary:hover,
.btn-secondary:hover {
    background-color: #333333;
    text-decoration: none;
    color: white;
}

.button.danger {
    background-color: #dc3545;
    color: white;
}

.button.danger:hover {
    background-color: #c82333;
    text-decoration: none;
    color: white;
}

/* Table Styles */
.modern-table,
table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modern-table th,
.modern-table td,
table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.modern-table th,
table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
}

.modern-table tbody tr:hover,
table tbody tr:hover {
    background-color: #f8f9fa;
}

.modern-table tbody tr:last-child td,
table tbody tr:last-child td {
    border-bottom: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: block; /* Change from flex to block for absolute positioning */
}

/* Image Modal Specific Styling */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
}

.image-modal .image-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    /* Inner padding to visibly show a 16px inset around content */
    padding: 16px;
    width: min(850px, calc(100vw - 32px));
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: calc(50% + 140px); /* Center of viewport + half sidebar width (280px / 2) */
    transform: translate(-50%, -50%); /* Perfect centering regardless of modal size */
    display: grid;
    grid-template-rows: 1fr auto; /* image area + caption */
}

.image-modal .modal-image {
    width: 100%;
    height: 100%; /* fill available image area */
    display: block;
    object-fit: contain; /* maintain aspect ratio */
    background: #f8f9fa; /* subtle background to visualize 16px padding */
    border-radius: 4px;
}

.image-modal .image-modal-caption {
    padding: 16px 4px 4px 4px; /* only top padding; others zero to avoid double spacing */
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.image-modal .image-modal-caption h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
}

.image-modal .image-modal-caption p {
    margin: 0;
    color: #555;
    font-size: 14px;
}

.image-modal .image-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    color: #555;
    cursor: pointer;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    padding: 0 6px;
    line-height: 1.2;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: calc(50% + 140px); /* Center of viewport + half sidebar width */
    transform: translate(-50%, -50%); /* Perfect centering regardless of modal size */
}

/* Alternative: Specific height classes */
.modal-content.modal-min-250 { min-height: 250px; }
.modal-content.modal-min-300 { min-height: 300px; }
.modal-content.modal-min-350 { min-height: 350px; }
.modal-content.modal-min-400 { min-height: 400px; }
.modal-content.modal-min-450 { min-height: 450px; }
.modal-content.modal-min-500 { min-height: 500px; }
.modal-content.modal-min-600 { min-height: 600px; }
.modal-content.modal-min-700 { min-height: 700px; }
.modal-content.modal-min-800 { min-height: 800px; }
.modal-content.modal-min-900 { min-height: 900px; }
.modal-content.modal-min-1000 { min-height: 1000px; }

.modal-header {
    padding: 24px 24px 8px 24px; /* Reduced bottom padding for 8px gap to horizontal rule */
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Changed to flex-start to handle multi-line headers */
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #0039A6;
    font-size: 20px;
}

/* Modal subheader/subtitle styling */
.modal-header .modal-subtitle,
.modal-header .modal-subheader,
.modal-header p,
.modal-header .subtitle {
    margin: 4px 0 0 0; /* 4px top margin for spacing from title */
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-top: -4px; /* Offset to align with title when using flex-start */
}

.modal-close:hover {
    background-color: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 16px 24px 24px 24px; /* 16px top padding for 24px total gap from header (8px header + 16px body) */
    flex: 0 1 auto; /* Don't force expansion, but allow shrinking */
}

/* Remove bottom margin from last element in modal body */
.modal-body > *:last-child {
    margin-bottom: 0;
}

/* Remove bottom margin from last message-box in modal body (including nested) */
.modal-body > .message-box:last-child,
.modal-body > *:last-child > .message-box:last-child {
    margin-bottom: 0;
}

/* Reduce top margin for first message-box in modal body */
.modal-body > .message-box:first-child,
.modal-body > *:first-child > .message-box:first-child {
    margin-top: 0px; /* Reduced from default 16px */
}

/* Remove margin from first child elements in modal-body to prevent double spacing */
.modal-body > *:first-child {
    margin-top: 0;
}

.modal-footer {
    padding: 8px 24px 8px 24px; /* Balanced top and bottom padding */
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background-color: #0039A6;
    color: white;
}

.modal-button:hover {
    background-color: #002d7a;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 12px; /* small gap from top of viewport */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: 600px; /* slightly wider */
    width: calc(100% - 24px); /* responsive on very small screens */
}

.alert-success,
.alert-error,
.alert-warning,
.alert-info {
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease;
}

.alert-success {
    background-color: #d4edda;
    color: black;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: black;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: black;
    border-color: #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: black;
    border-color: #bee5eb;
}

.alert-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* New Home layout */
.home-container {
    max-width: 1400px; /* Explicit set width container */
    margin: 0 auto;
    padding: 0 12px;
}

/* Normalize vertical spacing on Home to match card grid gap */
.home-container > .section-card {
    margin-bottom: 16px; /* match features grid gap */
}

/* Masonry-like responsive rows with fixed card width */
.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px; /* horizontal and vertical */
    margin: 16px 0; /* equal spacing above and below, collapses with header margin */
}

/* Ensure all feature cards have equal height */
.features-container .section-card.feature-card {
    display: flex;
    flex-direction: column;
}

/* Remove default margins inside grid items; rely on grid gap instead */
.features-container .section-card {
    margin: 0 !important;
}

.features-container .section-card.feature-card .section-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Center the image container vertically within its space */
.features-container .section-card.feature-card .section-card-body > div:first-child {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive: tweak card min widths for smaller screens */
@media (max-width: 1200px) {
    .features-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.home-container .section-card.feature-card img,
.features-container .section-card.feature-card img {
    width: 100%;
    height: auto; /* maintain aspect ratio */
    display: block;
    margin-bottom: 16px; /* space between image and description */
}

/* Feature card body spacing: ensure 16px from description to card bottom */
.features-container .section-card.feature-card .section-card-body,
.home-container .section-card.feature-card .section-card-body {
    padding-bottom: 16px;
}

.features-container .section-card.feature-card .section-card-body p,
.home-container .section-card.feature-card .section-card-body p {
    margin-bottom: 0; /* rely on body padding for the final 16px gap */
}

@media (max-width: 768px) {
    .home-container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .features-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.card-title {
    color: #0039A6;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.card-subtitle {
    color: #666;
    margin: 4px 0 0 0;
    font-size: 14px;
}

.card-content,
.card-body {
    color: #333;
    line-height: 1.6;
}

/* Global Dropdown Styles (moved from tables.css for universal availability) */
.dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.dropdown-toggle {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-toggle:hover {
    border-color: #0039A6;
    background-color: #f8f9fa;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    color: #666;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu li {
    list-style: none;
    margin: 0;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu li a:hover {
    background-color: #f8f9fa;
    color: #0039A6;
}

/* Section Card Styles - Default card styling for main content */
.section-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.section-card-header {
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.section-card-title {
    color: #0039A6;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.section-card-body {
    padding: 24px;
}

/* Section Card Responsive Styles */
@media (max-width: 768px) {
    .section-card-header {
        padding: 16px 20px 12px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .section-card-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .section-card-header {
        padding: 12px 16px 8px 16px;
    }
    
    .section-card-body {
        padding: 16px;
    }
    
    .section-card-title {
        font-size: 18px;
    }
}

/* Table Hint Styles - Available globally for modals */
.table-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background-color: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 6px;
    font-size: 13px;
    color: #0c5460;
    line-height: 1.4;
    width: 100%; /* Span full width */
    box-sizing: border-box;
    margin: 0; /* Remove margin since it's now separate */
}

.table-hint i {
    color: #0039A6;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Table hint responsive styles */
@media (max-width: 768px) {
    .table-hint {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .table-hint {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Message Box Styles */
.message-box {
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 6px;
    border-left: 4px solid #0039A6;
    background-color: #f8f9ff;
    font-size: 14px;
    line-height: 1.5;
}

.message-box h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-box p,
.message-box ul,
.message-box ol {
    margin: 8px 0 0 0;
}

.message-box p:first-child,
.message-box ul:first-child,
.message-box ol:first-child {
    margin-top: 0;
}

.message-box p:last-child,
.message-box ul:last-child,
.message-box ol:last-child {
    margin-bottom: 0;
}

/* Message Box Variants */
.message-box.standard {
    border-left-color: #0039A6;
    background-color: #f8f9ff;
}

.message-box.note {
    border-left-color: #ffc107;
    background-color: #fff9e6;
}

.message-box.warning,
.message-box.alert {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.message-box.success {
    border-left-color: #28a745;
    background-color: #f8fff8;
}

.message-box.link {
    border-left-color: #7c3aed;
    background-color: #faf7ff;
}

.message-box.thin {
    border-left-color: #0039A6;
    background-color: #f8f9ff;
    font-size: 13px;
}

.message-box.thin h4 {
    margin-top: 0;
    margin-bottom: 0;
}

.message-box.thin p,
.message-box.thin ul,
.message-box.thin ol {
    margin-top: 0;
    margin-bottom: 0;
}

/* List Styles */
.dash-list {
    list-style-type: none;
}

.dash-list li:before {
    content: "– ";
    margin-left: -1em;
    margin-right: 0.5em;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .modal-content {
        left: 50%; /* Center normally on mobile */
        transform: translate(-50%, -50%); /* Standard perfect centering */
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 64px; /* Adjust for smaller mobile header */
    }
    
    .unified-header {
        padding: 12px 16px;
        min-height: 64px;
    }
    
    .header-center {
        /* Remove sidebar offset on mobile - sidebar is hidden */
        margin-left: 0;
    }
    
    .sidebar {
        top: 64px; /* Adjust sidebar position for mobile header */
        height: calc(100vh - 64px);
    }
    
    .app-layout {
        min-height: calc(100vh - 64px);
    }
    
    .header-left,
    .header-right {
        min-width: 120px;
    }
    
    .brand-text {
        font-size: 16px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .section {
        padding: 16px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    .user-email {
        display: none;
    }
    
    .nav-text {
        display: none;
    }
    
    .auth-btn .nav-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .unified-header {
        padding: 8px 12px;
    }
    
    .header-center {
        /* Ensure no sidebar offset on small mobile devices */
        margin-left: 0;
    }
    
    .brand-icon {
        width: 24px;
        height: 24px;
    }
    
    .brand-text {
        font-size: 14px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .section {
        padding: 12px;
    }
    
    .form-input,
    .form-select {
        padding: 10px 12px;
    }
    
    .button,
    .btn-primary,
    .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Static Card Styles - looks like collapsible tab but no functionality */
.static-card {
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.static-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.static-card .section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    width: 100%;
    margin: 0;
}

.static-card .section-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0039A6;
    flex: 1;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
}

.static-card .section-card-content {
    max-height: none;
    overflow: visible;
    opacity: 1;
    padding: 16px 20px;
}

.static-card .section-card-body {
    padding: 0;
}

/* Collapsible Tab Styles */

.collapsible-tab {
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.collapsible-tab:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Collapsible header - clickable area */
.collapsible-tab .section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    border-bottom: 1px solid transparent;
    width: 100%;
    margin: 0;
}

/* Hover background removed */

.collapsible-tab.expanded .section-card-header {
    border-bottom-color: #e9ecef;
    background: white;
}

/* Expanded hover background removed */

/* Card title styling */
.collapsible-tab .section-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0039A6;
    flex: 1;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Chevron icon styling */
.collapsible-tab .section-card-header i {
    font-size: 16px;
    color: #6b7280;
    transition: all 0.3s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Icon hover color removed */

/* Rotate chevron when expanded */
.collapsible-tab.expanded .section-card-header i {
    transform: rotate(180deg);
    color: #0039A6;
}

/* Content area */
.collapsible-tab .section-card-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
}

.collapsible-tab.expanded .section-card-content {
    max-height: none;
    opacity: 1;
    padding: 16px 20px;
}

/* Content body styling */
.collapsible-tab .section-card-body {
    padding: 0;
}

/* Minimize margins on first and last elements inside content */
.collapsible-tab .section-card-content > *:first-child,
.collapsible-tab .section-card-body > *:first-child {
    margin-top: 0;
}

.collapsible-tab .section-card-content > *:last-child,
.collapsible-tab .section-card-body > *:last-child {
    margin-bottom: 0;
}

/* Minimize margins on first and last elements inside content */
.static-card .section-card-content > *:first-child,
.static-card .section-card-body > *:first-child {
    margin-top: 0;
}

.static-card .section-card-content > *:last-child,
.static-card .section-card-body > *:last-child {
    margin-bottom: 0;
}

/* Badge styling in headers */
.collapsible-tab .section-card-title .table-badge,
.collapsible-tab .section-card-title .blue-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-block;
}

/* Badge styling in headers */
.static-card .section-card-title .table-badge,
.static-card .section-card-title .blue-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-block;
}

.collapsible-tab .section-card-title .table-badge {
    background: #dcfce7;
    color: #166534;
}

.collapsible-tab .section-card-title .blue-badge {
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 400;
}

.static-card .section-card-title .table-badge {
    background: #dcfce7;
    color: black;
    font-weight: 400;
}

.static-card .section-card-title .blue-badge {
    background: #e0e7ff;
    color: black;
    font-weight: 400;
}

/* Smooth animation for content reveal */
.collapsible-tab .section-card-content {
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease;
}

.collapsible-tab.expanded .section-card-content {
    animation: expandContent 0.4s ease forwards;
}

@keyframes expandContent {
    0% {
        max-height: 0;
        opacity: 0;
        padding: 0 20px;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        max-height: 100vh;
        opacity: 1;
        padding: 16px 20px;
    }
}

/* Focus and accessibility */
.collapsible-tab .section-card-header:focus {
    outline: none;
}

.collapsible-tab .section-card-header:focus-visible {
    outline: none;
}

/* Active state removed */

/* Responsive adjustments */
@media (max-width: 768px) {
    .collapsible-tab .section-card-header {
        padding: 10px 16px;
    }
    
    .collapsible-tab .section-card-title {
        font-size: 16px;
    }
    
    .collapsible-tab.expanded .section-card-content {
        padding: 12px 16px;
    }
    
    .collapsible-tab .section-card-title .table-badge,
    .collapsible-tab .section-card-title .blue-badge {
        font-size: 11px;
        padding: 2px 6px;
        margin-left: 6px;
    }
}

@media (max-width: 480px) {
    .collapsible-tab .section-card-header {
        padding: 8px 12px;
    }
    
    .collapsible-tab .section-card-title {
        font-size: 15px;
    }
    
    .collapsible-tab.expanded .section-card-content {
        padding: 10px 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .collapsible-tab {
        border-width: 2px;
    }
    
    .collapsible-tab .section-card-header {
        border-bottom-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .collapsible-tab,
    .collapsible-tab .section-card-header,
    .collapsible-tab .section-card-header i,
    .collapsible-tab .section-card-content {
        transition: none;
    }
    
    .collapsible-tab.expanded .section-card-content {
        animation: none;
    }
    
    .collapsible-tab.expanded .section-card-header i {
        transform: rotate(180deg);
    }
}

/* Section Thin Card Styles - For cards that need less vertical padding */
.section-thin-card .section-card-header {
    padding: 12px 20px 8px 20px;
}

.section-thin-body {
    padding: 8px 20px 12px 20px;
}

/* FAQ Number Icons */
.faq-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #0039A6;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    margin-left: -8px;
    flex-shrink: 0;
}

/* Ensure FontAwesome icons inside faq-number stay white and don't rotate */
.faq-number i {
    color: white !important;
    transform: none !important;
    transition: none !important;
    margin: 0 !important;
}

/* FAQ Container Width Constraints */
.faq-container {
    max-width: 1200px; /* increased from 1000px */
    margin: 0 auto;
    width: 100%;
}

/* Getting Started: 2x2 grid for static cards */
.faq-container .static-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Standardized static-card height */
.faq-container .static-grid .static-card {
    display: block;
    margin-bottom: 0; /* grid gap controls spacing */
}

.faq-container .static-grid .static-card .section-card-content {
    overflow: visible;
}

@media (max-width: 900px) {
    .faq-container .static-grid {
        grid-template-columns: 1fr; /* stack on small screens */
    }
}

/* Generic blue-badge styling for use outside titles */
.blue-badge {
    background: #e0e7ff;
    color: black;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

/* Responsive width adjustments for FAQ */
@media (max-width: 1240px) {
    .faq-container {
        margin: 0 20px;
    }
}

@media (max-width: 768px) {
    .faq-container {
        margin: 0 16px;
        max-width: none;
    }
}

/* Getting Started: smaller body text inside message boxes */
.faq-container .message-box p,
.faq-container .message-box ul,
.faq-container .message-box ol {
    font-size: 12px;
}

/* Getting Started: smaller headings in message boxes */
.faq-container .message-box h4,
.faq-container .message-box h5 {
    font-size: 14px; /* override base 16px for tighter layout */
}

/* Getting Started: gold badge style overrides */
.faq-container .blue-badge {
    background: #fff7cc !important; /* lighter yellow */
    border: 1px solid #daa520 !important; /* goldenrod */
    color: #333 !important;
}

/* Sidebar Footer Styling */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    border-top: 1px solid white;
    background: white;
    margin-top: auto;
    height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0 0 8px 0;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid black;
    background: rgba(0, 0, 0, 0.1);
    color: black;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.social-link:hover {
    background: rgba(0, 0, 0, 0.2);
    color: black;
    transform: translateY(-2px);
}

.footer-info {
    text-align: center;
    color: rgba(0, 0, 0, 0.8);
    font-size: 11px;
    line-height: 1.3;
    margin: 0;
}

.footer-text {
    font-weight: 600;
    color: black;
    margin: 0 0 2px 0;
}

.footer-version {
    color: rgba(0, 0, 0, 0.7);
    margin: 0 0 2px 0;
}

.footer-copyright {
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
}

/* Mobile adjustments for sidebar footer */
@media (max-width: 768px) {
    .sidebar-footer {
        height: 60px;
        padding: 0 16px;
    }
    
    .social-links {
        gap: 12px;
        margin-bottom: 6px;
    }
    
    .social-link {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Draft Pool Container - styled like EndGameActions */
.draft-pool-container {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 10px 10px 40px;
    background-color: #f9f9f9;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    justify-content: center;
}

.draft-pool-container > div {
    text-align: left;
    margin-top: 12px;
}

.draft-pool-container h5 {
    text-align: left;
    margin-bottom: 8px;
}

.draft-pool-container h5 i {
    margin-right: 8px;
}

/* GameWinnerModal specific styling */
#GameWinnerModal .modal-content {
    max-width: 800px;
    width: 95%;
}

/* DraftIdModal specific styling */
#DraftIdModal .modal-content {
    max-width: 800px;
    width: 95%;
    overflow: visible !important;
}

/* ReviseModal specific styling */
#ReviseModal .modal-content {
    width: 900px;
    max-width: 90vw;
    min-height: 800px; /* Increased from 700px */
    overflow: visible !important; /* Allow dropdowns to extend outside modal bounds */
}

/* ReviseMultiModal specific styling */
#ReviseMultiModal .modal-content {
    width: 500px;
    max-width: 90vw;
    min-height: 400px;
}

/* DraftIdModal Dropdown Button Styling (matches ReviseModal) */
#DraftIdModal .dropdown-toggle {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#DraftIdModal .dropdown-toggle:hover {
    border-color: #0039A6;
    box-shadow: 0 2px 4px rgba(0, 57, 166, 0.1);
}

#DraftIdModal .dropdown-toggle i {
    margin-left: 8px;
    transition: transform 0.2s ease;
    color: #666 !important;
}

#DraftIdModal .dropdown-toggle span {
    color: #333 !important;
}

#DraftIdModal .dropdown-toggle:disabled {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    cursor: not-allowed;
    border-color: #ddd;
}

#DraftIdModal .dropdown-toggle:disabled span {
    color: #333 !important;
}

#DraftIdModal .dropdown-toggle:disabled i {
    color: #999 !important;
}

#DraftIdModal .dropdown-menu {
    position: absolute;
    top: auto;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15); /* Flip shadow for upward flow */
    z-index: 99999;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    font-size: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

#DraftIdModal .dropdown-menu.show {
    display: block;
}

#DraftIdModal .dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 6px 12px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    display: block;
    text-align: center;
}

#DraftIdModal .dropdown-menu li:last-child {
    border-bottom: none;
}

#DraftIdModal .dropdown-menu li:hover {
    background-color: #0039A6 !important;
    color: white !important;
    font-weight: 500 !important;
}

#GameWinnerModal .modal-footer {
    justify-content: center;
}

/* EndGameActions styling with fixed height and scrollbar */
#EndGameActions {
    height: 375px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

/* Center dropdown in DraftIdModal */
.dropdown-container-center {
    display: flex;
    justify-content: center;
    position: relative;
}

.dropdown-container-center .dropdown {
    position: relative;
}

/* BestGuessModal Dropdown Button Styling (matches ReviseModal) */
#BestGuessModal .dropdown-toggle {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#BestGuessModal .dropdown-toggle:hover {
    border-color: #0039A6;
    box-shadow: 0 2px 4px rgba(0, 57, 166, 0.1);
}

#BestGuessModal .dropdown-toggle i {
    margin-left: 8px;
    transition: transform 0.2s ease;
    color: #666 !important;
}

#BestGuessModal .dropdown-toggle span {
    color: #333 !important;
}

#BestGuessModal .dropdown-toggle:disabled {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    cursor: not-allowed;
    border-color: #ddd;
}

#BestGuessModal .dropdown-toggle:disabled span {
    color: #333 !important;
}

#BestGuessModal .dropdown-toggle:disabled i {
    color: #999 !important;
}

#BestGuessModal .dropdown-menu {
    position: absolute;
    bottom: auto;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Flip shadow for upward flow */
    z-index: 99999;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    font-size: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

#BestGuessModal .dropdown-menu.show {
    display: block;
}

#BestGuessModal .dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 6px 12px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    display: block;
    text-align: center;
}

#BestGuessModal .dropdown-menu li:last-child {
    border-bottom: none;
}

#BestGuessModal .dropdown-menu li:hover {
    background-color: #0039A6 !important;
    color: white !important;
    font-weight: 500 !important;
}

/* Profile page button width customization */
#EditProfileButton {
    width: 150px;
    justify-content: center;
    text-align: center;
}

#CancelProfileButton {
    width: 150px;
    justify-content: center;
    text-align: center;
}   

#SaveProfileButton {
    width: 150px;
    justify-content: center;
    text-align: center;
}

/* Modal footer button controls */
.modal-footer .button,
.modal-footer button,
.modal-footer .btn-primary,
.modal-footer .btn-secondary,
.modal-footer .btn {
    width: 150px;
    justify-content: center;
    text-align: center;
}

/* Game Winner Modal specific footer buttons */
#GameWinnerModal .modal-footer .button {
    /* Center all footer buttons in this modal, but do not change width here */
    justify-content: center;
    text-align: center;
}

#GameWinnerModal .modal-footer .button.primary {
    /* Only widen Player buttons (primary). Skip (secondary) keeps global width */
    width: 200px;
}