/* Additional styling improvements for the admin interface */

/* Prevent page shift when modals open (scrollbar compensation) */
html {
    scrollbar-gutter: stable;
}



body {
    padding-right: 0 !important;
    background: #f8f9fa; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s ease;
}

/* Header Styles */
.header { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; 
    padding: 1.5rem 0 1rem 0; /* padding at top and bottom */
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-link {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Responsive brand logo */
.brand-logo {
    height: 48px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .brand-logo {
        height: 32px;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        height: 28px;
    }
}

/* Small logo for pages with custom titles */
.brand-logo-small {
    height: 32px;
}

@media (max-width: 768px) {
    .brand-logo-small {
        height: 28px;
    }
}

@media (max-width: 480px) {
    .brand-logo-small {
        height: 24px;
    }
}

/* Custom page title styling */
.page-title-custom {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Hide custom title at all sizes (breadcrumb serves this purpose) */
.custom-title {
    display: none !important;
}

/* Account dropdown - hidden by default (only shown below 991px on index.php) */
.account-dropdown-wrapper {
    display: none;
}

/* Header icons wrapper (notification bell + account) - always visible on index.php */
.header-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* On index.php, always show the compact header icons wrapper */
.page-index .header-icons-wrapper {
    display: flex !important;
}

/* On index.php, hide the desktop header items (user info, separate buttons) */
.page-index .header-items-desktop {
    display: none !important;
}

/* On index.php, show the account dropdown within the header icons wrapper */
.page-index .header-icons-wrapper .account-dropdown-wrapper {
    display: block;
}

/* Account dropdown button - bigger and white (matches notification bell) */
.account-dropdown-btn {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.5rem;
    transition: all 0.2s ease;
}
.account-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.account-dropdown-btn i {
    font-size: 1.75rem;
}

/* Account dropdown menu - wider on desktop */
@media (min-width: 800px) {
    .account-dropdown-menu {
        min-width: 21rem;
    }
}

/* Header items desktop - shown by default (hidden below 991px on index.php) */
.header-items-desktop {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Responsive page title positioning */
@media (max-width: 768px) {
    .page-title-custom {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title-custom {
        font-size: 0.9rem;
    }
}

/* Custom breadcrumb styling */
.breadcrumb-custom {
    font-size: 0.85rem;
}

.breadcrumb-custom .breadcrumb-item a {
    color: #ffffff !important;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.breadcrumb-custom .breadcrumb-item a:hover {
    color: #e0e0e0 !important;
    text-decoration: underline;
}

.breadcrumb-custom .breadcrumb-item.active {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    color: #ffffff !important;
    content: "›";
}

.brand-link:hover {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
    transform: scale(1.02);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions .btn {
    font-weight: 500;
    border-width: 2px;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.header-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.header-actions .btn:active {
    transform: translateY(0);
}

.header-actions .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.header-actions .btn.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.375rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.username {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

.organization {
    font-size: 0.8rem;
    opacity: 0.8;
}

.logout { 
    color: #fff!important; 
    background: rgba(0, 0, 0, 0.8); 
    padding: 0.5rem 1rem; 
    border-radius: 25px; 
    text-decoration: none; 
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout:hover { 
    background: #000; 
    color: #fff!important;
}

/* Enhanced card hover effects */
.content-card {
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: #fff;
    transition: all 0.3s ease;
}

.content-card:hover {
    /* Only box-shadow, no transform to avoid stacking context issues */
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* New row-based layout styles */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-row {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.content-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.content-row-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.content-preview-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.move-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 32px;
    flex-shrink: 0;
    height: 100px;
    padding: 0.5rem 0;
}

.move-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: white;
    border: 1px solid #764ba2;
    color: #764ba2;
    transition: all 0.3s ease;
}

.move-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #764ba2;
    color: white;
}

.move-btn-placeholder {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.content-details {
    flex-grow: 1;
    min-width: 0; /* Allows text truncation */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-type {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.edit-btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.delete-btn {
    padding: 0.375rem 0.5rem;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-info-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.content-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
}

.content-path {
    font-size: 0.8rem;
    color: #6c757d;
    word-break: break-all;
    line-height: 1.4;
}

/* Order indicators for better chronology understanding */
.content-row {
    position: relative;
}

.content-row::before {
    content: counter(content-counter);
    counter-increment: content-counter;
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

/* Hover effect removed */

.content-list {
    counter-reset: content-counter;
    padding-left: 2rem;
}

/* Better spacing for content info */
.content-info > div {
    margin-bottom: 0.25rem;
}

/* Improved dropdown styling */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Enhanced modal styling */
.modal-backdrop {
    backdrop-filter: blur(5px);
}

.modal-content {
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Image preview modal styling */
#imagePreviewModal .modal-dialog {
    max-width: 75vw;
    max-height: 75vh;
    margin: 2vh auto;
}

/* Prevent modal body shift */
.modal-open {
    padding-right: 0 !important;
}

.modal {
    padding-right: 0 !important;
}

/* Screen Selection Interface */
.screen-selection {
    padding: 3rem 0;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); */
    position: relative;
}

.screen-selection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23f1f3f4" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.screen-selection .text-center {
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.screen-selection h2 {
    font-size: 2.0rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.screen-selection p {
    font-size: 0.9rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.screens-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-card {
    width: 200px;
    height: 200px;
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Compact variant for dashboard cards */
.kv-card-sm.screen-card {
    width: 160px;
    height: 160px;
    padding: 1rem;
}

.kv-card-sm .screen-icon {
    font-size: 2.5rem;
}

.kv-card-sm .screen-title {
    font-size: 0.9rem;
}

/* Sticky widget helper */
.kv-widget-sticky {
    position: sticky;
    top: 1rem;
}

/* =============================================================================
   RESSURSHJØRNET WIDGET STYLING
   ============================================================================= */

/* Widget container */
.kv-widget-resources {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.kv-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.kv-widget-body {
    padding: 1.25rem;
}

/* Resource items */
.kv-resource-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease, border-radius 0.2s ease;
}

.kv-resource-item:last-child {
    border-bottom: none;
}

.kv-resource-item:hover {
    background: #f8fafc;
    border-radius: 0.5rem;
}

.kv-resource-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

.kv-resource-content {
    flex: 1;
    min-width: 0;
}

.kv-resource-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.kv-resource-text {
    color: #334155;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.kv-resource-link {
    display: inline-block;
    margin-top: 0.5rem;
}

.kv-resource-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.kv-resource-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Featured item styling */
.kv-resource-featured {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.kv-resource-featured .kv-resource-label {
    color: #92400e;
}

/* Button styling */
.kv-btn-resources {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.kv-btn-resources:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Loading states */
.kv-resource-loading {
    display: flex;
    align-items: center;
    color: #64748b;
    font-size: 0.875rem;
}

.kv-resource-loading .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* =============================================================================
   ARTICLE COMPONENTS STYLING
   ============================================================================= */

/* Article cards */
.article-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: white;
    transition: all 0.2s ease;
    overflow: hidden;
}

.article-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.article-card.dragging {
    opacity: 0.6;
    transform: rotate(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Article metadata */
.article-meta {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.article-meta i {
    font-size: 0.75rem;
}

/* Article actions */
.article-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.article-card:hover .article-actions {
    opacity: 1;
}

/* Queue management */
.queue-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.queue-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.queue-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.queue-item.dragging {
    opacity: 0.5;
    transform: rotate(1deg);
}

.queue-handle {
    cursor: move;
    color: #94a3b8;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.queue-handle:hover {
    color: #64748b;
}

/* Statistics cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stats-card h4 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stats-card small {
    opacity: 0.9;
    font-size: 0.875rem;
}

.stats-card i {
    opacity: 0.8;
}

/* Filter section */
.filter-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Editor container */
.editor-container {
    min-height: 300px;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
}

.editor-container .ql-editor {
    min-height: 250px;
}

/* Modal enhancements */
.modal-lg {
    max-width: 90%;
}

.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* =============================================================================
   LOADING STATES AND ANIMATIONS
   ============================================================================= */

/* Spinner animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border {
    animation: spin 0.75s linear infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .kv-widget-resources {
        margin-bottom: 2rem;
    }
    
    .kv-resource-item {
        padding: 0.75rem 0;
    }
    
    .kv-resource-icon {
        font-size: 1.25rem;
        width: 2rem;
    }
    
    .article-card {
        margin-bottom: 1rem;
    }
    
    .queue-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .modal-lg {
        max-width: 95%;
    }
}

@media (max-width: 576px) {
    .kv-widget-body {
        padding: 1rem;
    }
    
    .kv-resource-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .queue-section {
        padding: 1rem;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    /* Responsive form inputs for mobile */
    .form-row input[type="number"] {
        flex: 0 0 100px;
        max-width: 120px;
        font-size: 0.9rem;
    }
    
    .form-row input[type="datetime-local"] {
        flex: 0 0 120px;
        max-width: 150px;
        font-size: 0.85rem;
    }
    
    .form-row input[type="datetime-local"][value] {
        font-size: 0.6rem;
        padding-right: 1.2rem;
        line-height: 1.2;
    }
    
    /* Start-time date wrapper on mobile - always on new row */
    .start-time-date-wrapper {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .start-time-date-wrapper .form-control {
        width: 100%;
        max-width: 100%;
    }
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

/* Focus states */
.kv-resource-item:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Remove scaling effects from widget buttons */
.kv-resource-actions .btn:hover {
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kv-resource-actions .btn {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.article-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .kv-widget-resources {
        border: 2px solid #000;
    }
    
    .article-card {
        border: 2px solid #000;
    }
    
    .queue-item {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .kv-widget-resources {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .article-actions,
    .queue-handle,
    .btn {
        display: none !important;
    }
    
    .article-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Ressurshjørnet Widget Styling */
.kv-widget-resources {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.12);
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.kv-widget-resources:hover {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.kv-widget-header {
    background: #f8f9fa;
    color: #495057;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.kv-widget-header h3 {
    color: #495057;
    font-size: 1.2rem;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.kv-widget-body {
    padding: 1.5rem;
}

.kv-resource-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.kv-resource-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kv-resource-item:last-of-type {
    margin-bottom: 0;
}

.kv-resource-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kv-resource-content {
    flex: 1;
    min-width: 0;
}

.kv-resource-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.kv-resource-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
    font-weight: 500;
}

.kv-resource-link {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.kv-resource-link:hover {
    color: #764ba2;
}

.kv-resource-desc {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.kv-resource-featured {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

.kv-resource-featured:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.kv-btn-resources {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.kv-btn-resources:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.kv-btn-resources:active {
    transform: translateY(0);
}

/* Responsive adjustments for widget */
@media (max-width: 991px) {
    .kv-widget-resources {
        margin-bottom: 2rem;
    }
    
    .kv-resource-item {
        padding: 1rem;
    }
    
    .kv-resource-icon {
        font-size: 1.75rem;
        width: 2rem;
        height: 2rem;
    }
    
    /* Header responsive improvements */
    .custom-title {
        display: none !important;
    }
    
    /* Account dropdown for index.php below 991px */
    .account-dropdown-wrapper {
        display: block;
    }
    
    .header-items-desktop {
        display: none !important;
    }
    
    /* Account dropdown button styling */
    .account-dropdown-btn {
        font-weight: 500;
        border-width: 2px;
        transition: all 0.3s ease;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-color: rgba(255, 255, 255, 0.3);
        color: #fff;
        padding: 0.5rem 0.75rem;
        font-size: 1.75rem;
    }
    
    .account-dropdown-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
        color: #fff;
    }
    
    .account-dropdown-btn:active {
        transform: translateY(0);
    }
    
    .account-dropdown-btn:focus {
        box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    }
    
    /* Account dropdown menu styling */
    .account-dropdown-menu {
        min-width: 220px;
        margin-top: 0.5rem;
    }
    
    .username-dropdown {
        font-size: 0.9rem;
        font-weight: 500;
        color: #495057;
    }
    
    .organization-dropdown {
        font-size: 0.8rem;
        color: #6c757d;
        margin-top: 0.25rem;
    }
    
    .account-dropdown-menu .dropdown-item-text {
        padding: 0.75rem 1rem;
    }
    
    /* Reorder layout: move upload section above playlist */
    /* Bootstrap rows already use flexbox, so we just need to set order */
    .col-lg-8.col-md-12 {
        order: 1;
    }
    
    .col-lg-4.col-md-12 {
        order: 0;
    }
    
    /* Compact upload section styles */
    .upload-section {
        padding: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .upload-section .h5 {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }
    
    .upload-tabs {
        margin-bottom: 0.75rem;
    }
    
    .upload-tabs .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .upload-area {
        padding: 0.5rem 0.4rem;
        border-radius: 8px;
        text-align: left;
    }
    
    .upload-area-content {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        align-items: center;
    }
    
    .upload-icon {
        font-size: 2rem;
        margin-bottom: 0;
        color: #adb5bd !important;
        display: block;
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: center;
        line-height: 1;
    }
    
    .upload-area:hover .upload-icon,
    .upload-area.dragover .upload-icon,
    .upload-area.uploading .upload-icon {
        color: #adb5bd !important;
    }
    
    .upload-title {
        font-size: 0.9rem;
        margin-bottom: 0.05rem;
        font-weight: 600;
        grid-column: 2;
    }
    
    .upload-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.05rem;
        grid-column: 2;
    }
    
    .upload-formats {
        font-size: 0.7rem;
        margin-bottom: 0;
        grid-column: 2;
    }
    
    .url-upload-area {
        padding: 0.5rem 0.4rem;
        text-align: left;
    }
    
    .url-icon {
        font-size: 1.5rem;
    }
    
    .url-upload-title {
        font-size: 0.9rem;
    }
    
    /* Compact URL and calendar upload clickable areas */
    .url-upload-clickable,
    .calendar-upload-clickable {
        padding: 0.75rem 0.5rem !important;
        text-align: left !important;
    }
    
    .url-upload-clickable i,
    .calendar-upload-clickable i {
        font-size: 1.5rem !important;
        display: inline-block;
        margin-right: 0.75rem;
        vertical-align: middle;
    }
    
    .url-upload-clickable h5,
    .calendar-upload-clickable h5 {
        display: inline-block;
        margin: 0 !important;
        vertical-align: middle;
        font-size: 0.9rem;
    }
    
    .url-upload-clickable p,
    .calendar-upload-clickable p {
        margin-top: 0.25rem;
        margin-bottom: 0;
        font-size: 0.75rem;
    }
    
    /* Compact playlist section header */
    .col-lg-8 .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    .col-lg-8 .h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .col-lg-8 .text-muted.small {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
}

.screen-card:active {
    transform: translateY(-4px) scale(0.98);
    transition: all 0.1s ease;
}

.screen-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.screen-card:hover {
    border-color: #667eea;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
    transform: translateY(-8px) scale(1.02);
}

.screen-card:hover::before {
    opacity: 0.05;
}

.screen-card.new-screen {
    border-style: dashed;
    border-color: #95a5a6;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
}

.screen-card.new-screen:hover {
    border-color: #27ae60;
    background: linear-gradient(135deg, #e8f5e8 0%, #d5f4d5 100%);
    box-shadow: 0 15px 40px rgba(39, 174, 96, 0.3);
}

.screen-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
    transition: all 0.4s ease;
    z-index: 2;
    position: relative;
}

.screen-card:hover .screen-icon {
    color: #764ba2;
    transform: scale(1.1);
}

.screen-card.new-screen .screen-icon {
    color: #27ae60;
}

.screen-card.new-screen:hover .screen-icon {
    color: #229954;
    transform: scale(1.1);
}

.screen-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    z-index: 2;
    position: relative;
    line-height: 1.3;
}

.screen-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.4;
    z-index: 2;
    position: relative;
}

/* Quick Actions, Screen Selection, and Help Sections - Reusing screen-card styles */
.quick-actions-section,
.screen-selection-section,
.help-section {
    margin-bottom: 3rem;
}

/* Quick Action Cards - Teal theme */
.screen-card.quick-action .screen-icon {
    color: #20c997;
}

.screen-card.quick-action:hover .screen-icon {
    color: #17a085;
    transform: scale(1.1);
}

.screen-card.quick-action:hover {
    border-color: #20c997;
    box-shadow: 0 15px 40px rgba(32, 201, 151, 0.3);
}

/* Admin quick-action cards - Dark gray theme */
.screen-card.quick-action.admin-action .screen-icon {
    color: #495057;
}

.screen-card.quick-action.admin-action:hover .screen-icon {
    color: #495057;
}

.screen-card.quick-action.admin-action:hover {
    border-color: #495057;
    box-shadow: 0 15px 40px rgba(73, 80, 87, 0.3);
}

/* Help Action Cards - Yellow theme */
.screen-card.help-action .screen-icon {
    color: #ffc107;
}

.screen-card.help-action:hover .screen-icon {
    color: #e0a800;
    transform: scale(1.1);
}

.screen-card.help-action:hover {
    border-color: #ffc107;
    box-shadow: 0 15px 40px rgba(255, 193, 7, 0.3);
}

/* Screen Switcher */
.screen-switcher .dropdown-toggle {
    min-width: 250px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tablet responsive adjustments */
@media (max-width: 1024px) {
    .screen-selection {
        padding: 2.5rem 0;
    }
    
    .screen-selection h2 {
        font-size: 2.25rem;
    }
    
    .screens-grid {
        gap: 2rem;
        padding: 0 1.5rem;
    }
    
    .screen-card {
        width: 180px;
        height: 180px;
        padding: 1.25rem;
    }
    
    .screen-icon {
        font-size: 3.5rem;
        margin-bottom: 0.75rem;
    }
    
    .screen-title {
        font-size: 0.95rem;
    }
    
    .screen-description {
        font-size: 0.8rem;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .screen-selection {
        padding: 2rem 0;
        min-height: auto;
    }
    
    .screen-selection h2 {
        font-size: 2rem;
    }
    
    .screen-selection p {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .screens-grid {
        gap: 1.5rem;
        padding: 0 1rem;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .screen-card {
        width: 160px;
        height: 160px;
        padding: 1rem;
    }
    
    .screen-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }
    
    .screen-title {
        font-size: 0.9rem;
    }
    
    .screen-description {
        font-size: 0.75rem;
    }
    
    .screen-switcher .dropdown-toggle {
        min-width: 200px;
    }
}

/* Small mobile responsive adjustments */
@media (max-width: 480px) {
    .screen-selection {
        padding: 1.5rem 0;
    }
    
    .screen-selection h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .screen-selection p {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
    
    .screens-grid {
        gap: 0.75rem;
        padding: 0 0.5rem;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        justify-items: center;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .screen-card {
        width: 105px;
        height: 105px;
        padding: 0.5rem;
    }
    
    .kv-card-sm.screen-card {
        width: 110px;
        height: 110px;
        padding: 0.55rem;
    }
    
    .kv-card-sm.screen-card .screen-icon {
        font-size: 1.5rem;
        margin-bottom: 0.35rem;
    }
    
    .kv-card-sm.screen-card .screen-title {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .screen-icon {
        font-size: 1.75rem;
        margin-bottom: 0.4rem;
    }
    
    .screen-title {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .screen-description {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    /* Adjust section spacing for mobile */
    .quick-actions-section,
    .screen-selection-section,
    .help-section {
        margin-bottom: 2rem;
    }
}

/* Extra small mobile responsive adjustments */
@media (max-width: 360px) {
    .screen-selection {
        padding: 1rem 0;
    }
    
    .screen-selection h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .screen-selection p {
        font-size: 0.85rem;
        padding: 0 0.25rem;
    }
    
    .screens-grid {
        gap: 0.75rem;
        padding: 0 0.25rem;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .screen-card {
        width: 110px;
        height: 110px;
        padding: 0.5rem;
    }
    
    .screen-icon {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .screen-title {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    .screen-description {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    /* Further reduce section spacing for very small screens */
    .quick-actions-section,
    .screen-selection-section,
    .help-section {
        margin-bottom: 1.5rem;
    }
}

/* Ultra small mobile responsive adjustments - single column only */
@media (max-width: 240px) {
    .screen-selection {
        padding: 0.75rem 0;
    }
    
    .screen-selection h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .screen-selection p {
        font-size: 0.8rem;
        padding: 0 0.125rem;
    }
    
    .screens-grid {
        gap: 0.75rem;
        padding: 0 0.125rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: none;
    }
    
    .screen-card {
        width: 100px;
        height: 100px;
        padding: 0.375rem;
    }
    
    .screen-icon {
        font-size: 1.5rem;
        margin-bottom: 0.125rem;
    }
    
    .screen-title {
        font-size: 0.65rem;
        line-height: 1.1;
    }
    
    .screen-description {
        font-size: 0.55rem;
        line-height: 1.1;
    }
    
    /* Minimal section spacing for ultra small screens */
    .quick-actions-section,
    .screen-selection-section,
    .help-section {
        margin-bottom: 1rem;
    }
}

#imagePreviewModal .modal-content {
    max-height: 75vh;
    overflow: hidden;
}

#imagePreviewModal .modal-body {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-height: 70vh;
}

#previewImage {
    max-width: 70vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Better form styling */
.form-control:focus {
    transform: scale(1.02);
}

/* Improved button states */
.btn:active {
    transform: scale(0.98);
}

/* Status badge improvements */
.status-badge {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Content preview enhancements */
.content-preview {
    transition: all 0.3s ease;
}

.content-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Upload section improvements */
.upload-section {
    border: 1px solid #e9ecef;
}

.upload-tabs .nav-link {
    transition: all 0.3s ease;
}

.upload-tabs .nav-link:hover {
    background-color: #f8f9fa;
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Playlist view optimizations */
    .content-list {
        padding-left: 2rem;
        gap: 0.5rem;
    }
    
    .content-row {
        margin-bottom: 0.5rem;
    }
    
    .content-row::before {
        left: -1.25rem;
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.65rem;
    }
    
    .content-row-inner {
        padding: 0.5rem;
        gap: 0.5rem;
        flex-direction: row;
        align-items: flex-start;
    }
    
    .content-preview-section {
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;
    }
    
    .content-preview {
        width: 80px;
        height: 60px;
    }
    
    .move-buttons {
        flex-direction: column;
        width: 28px;
        height: auto;
        padding: 0.25rem 0;
        gap: 0.25rem;
        justify-content: center;
    }
    
    .move-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .move-btn-placeholder {
        width: 28px;
        height: 28px;
    }
    
    .content-details {
        flex: 1;
        min-width: 0;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        margin-bottom: 0.4rem;
    }
    
    .content-meta {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .content-type {
        font-size: 0.75rem;
    }
    
    .content-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .edit-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        height: 32px;
        min-width: 80px;
        flex: 1;
        max-width: calc(50% - 0.2rem);
    }
    
    .delete-btn {
        padding: 0.3rem 0.5rem;
        min-width: 32px;
        height: 32px;
        flex: 1;
        max-width: calc(50% - 0.2rem);
    }
    
    .content-info-row {
        flex-direction: column;
        gap: 0.3rem;
        margin-bottom: 0.3rem;
        font-size: 0.75rem;
    }
    
    .content-info-item {
        gap: 0.4rem;
    }
    
    .info-label {
        font-size: 0.7rem;
    }
    
    .info-value {
        font-size: 0.75rem;
    }
    
    .content-path {
        font-size: 0.7rem;
        margin-top: 0.25rem;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success/error message styling */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Empty state improvements */
.text-muted {
    color: #6c757d !important;
}

/* Better visual hierarchy */
.h4, .h5, .h6 {
    font-weight: 600;
    color: #495057;
}

/* Enhanced accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Content Card Styles */
.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    cursor: pointer;
}

.content-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.content-preview {
    width: 140px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.content-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.content-preview.url {
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.content-preview.pdf {
    background: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.content-preview.calendar {
    background: linear-gradient(45deg, #28a745, #20c997);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.calendar-preview-mini {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    color: #333;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2px;
}

.calendar-title {
    font-weight: bold;
    font-size: 0.6rem;
    color: #28a745;
}

.calendar-date {
    font-size: 0.5rem;
    color: #6c757d;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    flex: 1;
    padding: 2px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: bold;
    color: #6c757d;
    min-height: 8px;
}

.calendar-event {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.4rem;
    color: #dc3545;
    min-height: 8px;
}

/* PDF Preview Canvas Styling */
.pdf-preview {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: contain;
}

.pdf-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-color: #dc3545;
}

.pdf-preview.loaded {
    background: white;
}

.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #dc3545;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}

.pdf-loading .loading-text {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-scheduled {
    background: #e9ecef;
    color: #495057;
}

.status-passed {
    background: #adb5bd;
    color: #343a40;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Upload Section Styles */
.upload-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.upload-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.upload-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
}

.upload-tabs .nav-link.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
    background: transparent;
}

.upload-tabs .nav-link:hover {
    background-color: #f8f9fa;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: scale(1.02);
}

.form-control:hover {
    border-color: #ced4da;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.preview-btn {
    background: #28a745;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-btn:hover {
    background: #218838;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Content Info Styles */
.content-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.content-info strong {
    color: #495057;
}

/* Modal Styles */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
}

@media (max-width: 576px) {
    .modal-body {
        padding: 0.85rem;
    }
}

.start-time-active {
    background: #eef2ff;
    border-radius: 12px;
    padding: 0.75rem;
}

.uploaded-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.uploaded-file-info .file-preview {
    flex: 0 0 auto;
}

.uploaded-file-info .file-details {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 576px) {
    .uploaded-file-info {
        align-items: flex-start;
    }
}

/* Enhanced Form Styling */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Form Spacing */
.modal-body .mb-3 {
    margin-bottom: 1.5rem !important;
}

.modal-body .mb-3:last-child {
    margin-bottom: 0 !important;
}

/* Input Field Enhancements */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

/* Status Indicator Styling */
.status-indicator {
    transition: all 0.3s ease;
}

.status-indicator .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.status-indicator .status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator .status-inactive {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-indicator .status-scheduled {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

.status-indicator .status-passed {
    background-color: #adb5bd;
    color: #343a40;
    border: 1px solid #9ca3af;
}

.status-indicator .status-badge {
    background-color: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* Color Picker Styling */
.theme-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.theme-input-group .form-control {
    flex: 1;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.color-picker:hover {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.color-picker:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.color-picker::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Enhanced Modal Styling */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

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

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Form Row Layout */
.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.form-row .form-label {
    flex: 0 0 auto;
    margin-bottom: 0;
    white-space: nowrap;
}

.form-row .form-control {
    flex: 0 0 200px;
    text-align: right;
}

/* Optional text styling - smaller and not bold */
.form-label .optional-text {
    font-size: 0.75em;
    font-weight: normal;
    color: #6c757d;
}

/* Narrower input widths for better mobile experience */
.form-row input[type="number"],
.form-row select.duration-input-mobile {
    flex: 0 0 120px;
    max-width: 150px;
}

.datetime-control input[type="datetime-local"],
.form-row input[type="datetime-local"] {
    flex: 0 0 150px;
    max-width: 180px;
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23667eea' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-12a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 4v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4H2zm1-2h1v.5a.5.5 0 0 0 1 0V2h6v.5a.5.5 0 0 0 1 0V2h1v1H3V2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 18px;
}

#datetime-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2147483000;
    display: none;
    opacity: 0;
    transition: opacity 0.03s ease;
    pointer-events: none;
}

.datetime-control input[type="datetime-local"][value],
.form-row input[type="datetime-local"][value] {
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.datetime-control input[type="datetime-local"]:hover,
.form-row input[type="datetime-local"]:hover {
    border-color: #667eea;
    background-color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.datetime-control input[type="datetime-local"]:focus,
.form-row input[type="datetime-local"]:focus {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-1px);
    color: #212529;
}

.datetime-control input[type="datetime-local"]::placeholder,
.form-row input[type="datetime-local"]::placeholder {
    color: #6c757d;
    font-style: italic;
}

.datetime-control input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-row input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
    background-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.datetime-control input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
.datetime-control input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator,
.form-row input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
.form-row input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* Ensure calendar icon shows on iOS Safari */
@supports (-webkit-touch-callout: none) {
    .datetime-control input[type="datetime-local"]::-webkit-calendar-picker-indicator,
    .form-row input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        opacity: 1 !important;
        display: block !important;
        visibility: visible !important;
    }
}

/* Wrapper for datetime input and action buttons */
.datetime-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.datetime-input-group {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    justify-content: flex-end;
}

.datetime-input-group .form-control {
    flex: 0 1 180px;
}

.datetime-actions-row {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 0.1rem;
}

.datetime-actions-row .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.datetime-actions .btn-icon {
    padding: 0.4rem 0.55rem;
}

.datetime-actions .btn-link {
    padding-left: 0;
    padding-right: 0;
}

/* Start-time field responsive layout */
.start-time-row {
    flex-wrap: wrap;
}

.start-time-date-wrapper {
    width: 100%;
    margin-top: 0.75rem;
    padding-left: 0;
}

.start-time-date-wrapper .form-control {
    width: 100%;
    max-width: 180px;
    margin-left: auto;
}

/* Theme input group in form row */
.form-row .theme-input-group {
    flex: 0 0 200px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-row .theme-input-group .form-control {
    flex: 1;
    text-align: right;
}

/* Section divider */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
    margin: 1.5rem 0;
}

/* Ensure placeholders are also right-aligned */
.form-control::placeholder {
    text-align: right;
}

/* Webkit browsers (Chrome, Safari) */
.form-control::-webkit-input-placeholder {
    text-align: right;
}

/* Firefox */
.form-control::-moz-placeholder {
    text-align: right;
}

/* Edge */
.form-control::-ms-input-placeholder {
    text-align: right;
}

/* Help icon styling */
.help-icon {
    color: #6c757d;
    cursor: help;
    margin-left: 0.5rem;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.help-icon:hover {
    opacity: 1;
    color: #667eea;
}

/* Toggle Switch Styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0;
}

.form-row .toggle-container {
    flex: 1;
    max-width: 200px;
    justify-content: flex-end;
}

/* Toggle label below button */
.toggle-label-below {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.toggle-label-below .toggle-label {
    font-size: 0.75rem;
    margin-top: 0.15rem;
    line-height: 1.2;
}

/* Collapse content fields - stack vertically */
.collapse-content .form-label {
    display: block;
    margin-bottom: 0.5rem;
}

.collapse-content .form-control {
    width: 100%;
    margin-bottom: 1rem;
}

.collapse-content .toggle-container {
    margin-top: 0.5rem; /* Margin top for toggle container */
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    cursor: pointer;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-input:focus + .toggle-slider {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.toggle-label {
    font-weight: 500;
    color: #495057;
    transition: color 0.3s ease;
}

.toggle-input:checked ~ .toggle-label {
    color: #667eea;
}

/* Upload Area Styles */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #28a745;
    background: #f0fff4;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

.upload-area.uploading {
    border-color: #667eea;
    background: #f0f2ff;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.upload-area.dragover .upload-icon {
    color: #28a745;
    transform: scale(1.1);
}

.upload-area.uploading .upload-icon {
    color: #667eea;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: block;
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.upload-formats {
    font-size: 0.875rem;
    color: #adb5bd;
    margin-bottom: 0;
}

.upload-progress {
    margin-top: 1rem;
}

.upload-status {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.upload-queue-info {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.upload-queue-info small {
    color: #0056b3 !important;
    font-weight: 500;
}

/* URL Upload Area Styles */
.url-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.url-upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.url-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: block;
}

.url-upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.url-upload-subtitle {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* URL Upload Clickable Area Styles */
.url-upload-clickable {
    transition: all 0.3s ease;
    border-radius: 8px;
    border: 2px solid transparent;
}

.url-upload-clickable:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-2px);
}

.url-upload-clickable:active {
    transform: translateY(0);
}

/* File Upload Settings Modal Styles */
.uploaded-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.file-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
}

.file-preview.image {
    background: #fff;
    border-color: #dee2e6;
    padding: 0;
}

.file-preview.pdf {
    background: #dc3545;
    border-color: #dc3545;
}

.file-preview.url {
    background: #17a2b8;
    border-color: #17a2b8;
}

.file-preview.generic {
    background: #6c757d;
    border-color: #6c757d;
}

/* Thumbnail specific styles */
.file-preview .file-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-preview.image:hover .file-thumbnail {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Loading state for thumbnails */
.file-preview.image .file-thumbnail {
    background: #f8f9fa;
}

/* Enhanced file preview container */
.file-preview.image {
    position: relative;
    background: #fff;
    border-color: #dee2e6;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.file-preview.image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.file-preview.image:hover::before {
    opacity: 1;
}

/* Loading spinner for thumbnails */
.thumbnail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #6c757d;
}

.thumbnail-loading .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.file-details h6 {
    margin-bottom: 0.25rem;
    color: #495057;
}

.file-details p {
    font-size: 0.875rem;
}

/* Display Selector Styles */
.display-selector {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
}

.display-selector option {
    color: #333;
}

.new-display-form {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.new-display-form input {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 6px;
}

/* Display Selection Compact View Styles */
.display-selection-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.display-selection-compact .form-label {
    flex: 0 0 auto;
    margin-bottom: 0;
    white-space: nowrap;
}

.display-selection-preview-wrapper {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    max-width: 100%;
}

.display-selection-preview {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    padding-right: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.display-selection-preview:hover {
    border-color: #667eea;
    background-color: #f8f9fa;
}

.display-selection-preview.expanded {
    background-color: #eef2ff;
    border-color: #667eea;
}

.display-selection-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #212529;
    font-size: 0.95rem;
    flex: 1 1 auto;
    min-width: 0;
}

.display-selection-arrow {
    flex: 0 0 auto;
    color: #667eea;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    margin-left: 0.25rem;
}

.display-selection-preview.expanded .display-selection-arrow {
    transform: rotate(180deg);
}

/* Mobile optimizations for display selection */
@media (max-width: 768px) {
    .display-selection-compact {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
    
    .display-selection-compact .form-label {
        flex: 0 0 auto;
        margin-bottom: 0;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .display-selection-compact .form-label span {
        display: inline-flex;
        align-items: center;
    }
    
    .display-selection-preview-wrapper {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
    
    .display-selection-preview {
        padding: 0.5rem 0.4rem;
        gap: 0.4rem;
        min-width: 0;
    }
    
    .display-selection-preview span {
        font-size: 0.9rem;
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .display-selection-arrow {
        font-size: 1rem;
        margin-left: 0;
        flex-shrink: 0;
        flex-basis: 1.2rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .display-selection-preview {
        padding: 0.45rem;
        padding-right: 0.35rem;
        gap: 0.3rem;
    }
    
    .display-selection-preview span {
        font-size: 0.85rem;
        max-width: calc(100% - 1.3rem);
    }
    
    .display-selection-arrow {
        font-size: 0.95rem;
        width: 1.1rem;
    }
}

.display-selection-expanded {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

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

/* Toast and Notification Styles */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.toast .toast-body {
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
}

.toast #undoLink {
    text-decoration: underline;
    font-weight: 600;
    transition: all 0.2s ease;
}

.toast #undoLink:hover {
    opacity: 0.8;
    text-decoration: none;
}

.toast .btn-close {
    filter: brightness(0) invert(1);
}

/* Delete Animation Styles */
.content-row {
    transition: all 0.3s ease;
}

.content-row.deleting {
    opacity: 0.5;
    transform: translateX(20px);
}

.content-row.deleted {
    opacity: 0;
    transform: translateX(100px);
    pointer-events: none;
}

.content-row.restoring {
    opacity: 0;
    transform: translateX(100px);
}

/* Moved Item Highlight Animation */
.content-card.moved-highlight {
    animation: movedHighlight 2s ease-out;
}

@keyframes movedHighlight {
    0% {
        background-color: #d4edda;
        border-color: #c3e6cb;
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
        transform: scale(1.02);
    }
    50% {
        background-color: #d4edda;
        border-color: #c3e6cb;
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.2);
        transform: scale(1.01);
    }
    100% {
        background-color: #ffffff;
        border-color: #e9ecef;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transform: scale(1);
    }
}

/* Number Input Styling */
.form-row input[type="number"] {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Make number input arrows always visible and larger */
.form-row input[type="number"]::-webkit-outer-spin-button,
.form-row input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;
    height: 32px;
    width: 32px;
    margin-right: 12px;
    border-radius: 6px;
    background-color: #667eea;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.form-row input[type="number"]::-webkit-inner-spin-button {
    background: #667eea url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 16 16'%3e%3cpath d='M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z'/%3e%3c/svg%3e") no-repeat center;
    background-size: 18px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.form-row input[type="number"]::-webkit-outer-spin-button {
    background: #667eea url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 16 16'%3e%3cpath d='M4 8a.5.5 0 0 1 .5-.5h3V4.5a.5.5 0 0 1 1 0V7.5h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0V8.5h-3A.5.5 0 0 1 4 8z'/%3e%3c/svg%3e") no-repeat center;
    background-size: 18px;
    transition: all 0.2s ease;
}

.form-row input[type="number"]::-webkit-inner-spin-button:hover,
.form-row input[type="number"]::-webkit-outer-spin-button:hover {
    background-color: #5a6fd8;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Move Button Enhancements */
.move-btn {
    transition: all 0.2s ease;
}

.move-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.move-btn-placeholder {
    width: 32px;
    height: 32px;
}

/* Drag and Drop Styles */
.content-card[draggable="true"] {
    cursor: grab;
    transition: all 0.2s ease;
}

.content-card[draggable="true"]:active {
    cursor: grabbing;
}

.content-row.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
    position: relative;
}

.content-row.dragging .content-card {
    cursor: grabbing;
}

.drop-zone {
    height: 4px;
    background: transparent;
    border: 2px dashed transparent;
    border-radius: 2px;
    margin: 2px 0;
    transition: all 0.15s ease;
    position: relative;
    opacity: 0;
}

.drop-zone.show {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.drop-zone:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.drop-zone.drop-zone-active {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    border-style: solid;
    height: 8px;
    margin: 1px 0;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
    transform: scaleY(1.2);
}

.drag-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .header-right {
        gap: 1rem;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .user-info {
        align-items: flex-end;
        text-align: right;
        margin-bottom: 0.75rem;
    }
    
    .username, .organization {
        font-size: 0.8rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .logout {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .content-card {
        margin-bottom: 1rem;
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .upload-section {
        padding: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .upload-section .h5 {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }
    
    .upload-tabs {
        margin-bottom: 0.75rem;
    }
    
    .upload-tabs .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .upload-area {
        padding: 0.5rem 0.4rem;
        border-radius: 8px;
        text-align: left;
    }
    
    .upload-area-content {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        align-items: center;
    }
    
    .upload-icon {
        font-size: 2rem;
        margin-bottom: 0;
        color: #adb5bd !important;
        display: block;
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: center;
        line-height: 1;
    }
    
    .upload-area:hover .upload-icon,
    .upload-area.dragover .upload-icon,
    .upload-area.uploading .upload-icon {
        color: #adb5bd !important;
    }
    
    .upload-title {
        font-size: 0.9rem;
        margin-bottom: 0.05rem;
        font-weight: 600;
        grid-column: 2;
    }
    
    .upload-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.05rem;
        grid-column: 2;
    }
    
    .upload-formats {
        font-size: 0.7rem;
        margin-bottom: 0;
        grid-column: 2;
    }
    
    /* Compact URL and calendar upload clickable areas */
    .url-upload-clickable,
    .calendar-upload-clickable {
        padding: 0.75rem 0.5rem !important;
        text-align: left !important;
    }
    
    .url-upload-clickable i,
    .calendar-upload-clickable i {
        font-size: 1.5rem !important;
        display: inline-block;
        margin-right: 0.75rem;
        vertical-align: middle;
    }
    
    .url-upload-clickable h5,
    .calendar-upload-clickable h5 {
        display: inline-block;
        margin: 0 !important;
        vertical-align: middle;
        font-size: 0.9rem;
    }
    
    .url-upload-clickable p,
    .calendar-upload-clickable p {
        margin-top: 0.25rem;
        margin-bottom: 0;
        font-size: 0.75rem;
    }
    
    /* Compact playlist section header */
    .col-lg-8 .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    .col-lg-8 .h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .col-lg-8 .text-muted.small {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
    
    /* Reduced left margin for better screen estate usage */
    .content-list {
        padding-left: 2rem;
    }
    
    .content-row::before {
        left: -1.25rem;
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.65rem;
    }
    
    /* Keep content on same row - don't stack vertically */
    .content-row-inner {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    /* Keep preview section on same row with scaled down thumbnails */
    .content-preview-section {
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;
        align-self: auto;
    }
    
    /* Ensure preview wrapper stays inline */
    .content-preview-wrapper {
        flex-shrink: 0;
        display: inline-block;
    }
    
    /* Order arrows on same row horizontally */
    .move-buttons {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.25rem;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        position: static;
        flex-shrink: 0;
    }
    
    .move-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .move-btn-placeholder {
        width: 28px;
        height: 28px;
    }
    
    /* Scale down thumbnails to fit on same row */
    .content-preview {
        width: 70px;
        height: 50px;
        object-fit: cover;
    }
    
    .content-preview.calendar {
        width: 70px;
        height: 50px;
    }
    
    .calendar-preview-mini {
        font-size: 0.6rem;
        padding: 3px;
    }
    
    .calendar-header {
        padding: 1px 3px;
        margin-bottom: 1px;
    }
    
    .calendar-title {
        font-size: 0.6rem;
    }
    
    .calendar-date {
        font-size: 0.55rem;
    }
    
    .calendar-name {
        font-size: 0.55rem;
        margin-top: 1px;
    }
    
    .calendar-grid {
        gap: 1px;
        padding: 1px;
    }
    
    .calendar-day,
    .calendar-event {
        font-size: 0.5rem;
        padding: 1px;
    }
    
    /* Smaller, better placed edit/delete buttons */
    .content-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.3rem;
    }
    
    .edit-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        height: 28px;
        min-width: auto;
    }
    
    .edit-btn .btn-text {
        display: none;
    }
    
    .delete-btn {
        padding: 0.25rem 0.5rem;
        min-width: 28px;
        height: 28px;
    }
    
    .content-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .content-details {
        flex: 1;
        min-width: 0;
    }
    
    .content-meta {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .content-type {
        font-size: 0.75rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.25em 0.6em;
    }
    
    .content-info-row {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Flexible button text hiding for top buttons */
    .btn-hide-text-mobile .btn-text {
        display: none;
    }
    
    .btn-hide-text-mobile {
        padding: 0.375rem 0.5rem;
        min-width: auto;
    }
    
    /* Preview button text hiding */
    .preview-btn .btn-text {
        display: none;
    }
    
    .preview-btn {
        padding: 0.375rem 0.5rem;
        min-width: auto;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .upload-title {
        font-size: 1.1rem;
    }
    
    .url-upload-area {
        padding: 2rem 1rem;
    }
    
    .url-icon {
        font-size: 2.5rem;
    }
    
    .url-upload-title {
        font-size: 1.1rem;
    }
    

    
    .toast {
        min-width: 280px;
        margin: 0 0.5rem 0.5rem 0;
    }
    
    .toast .toast-body {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }
    
    .content-card[draggable="true"] {
        cursor: default;
    }
    
    .drop-zone {
        display: none;
    }
}

/* Additional 480px styles are now consolidated in the main 480px media query above */

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Success/Error Message Styling */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Empty State Improvements */
.text-muted {
    color: #6c757d !important;
}

/* Better Visual Hierarchy */
.h4, .h5, .h6 {
    font-weight: 600;
    color: #495057;
}

/* Enhanced Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Calendar Modal Styles */
#editCalendarModal .modal-dialog {
    max-width: 900px;
}

#editCalendarModal .modal-body {
    padding: 1.5rem;
}

#editCalendarModal .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

#editCalendarModal .form-control,
#editCalendarModal .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#editCalendarModal .form-control:focus,
#editCalendarModal .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#editCalendarModal .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

#editCalendarModal .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#editCalendarModal .section-divider {
    margin: 1.5rem 0;
    border-color: #e9ecef;
}

#editCalendarModal .fw-bold {
    color: #495057;
}

#editCalendarModal .theme-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#editCalendarModal .color-picker {
    width: 40px;
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

#editCalendarModal .toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#editCalendarModal .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

#editCalendarModal .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

#editCalendarModal .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

#editCalendarModal .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

#editCalendarModal .toggle-input:checked + .toggle-slider {
    background-color: #667eea;
}

#editCalendarModal .toggle-input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

#editCalendarModal .toggle-label {
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Responsive adjustments for calendar modal */
@media (max-width: 768px) {
    #editCalendarModal .modal-dialog {
        max-width: 95vw;
        margin: 0.5rem auto;
    }
    
    #editCalendarModal .modal-body {
        padding: 1rem;
    }
    
    #editCalendarModal .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    #editCalendarModal .col-md-6,
    #editCalendarModal .col-md-3 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Calendar Management Styles */
#editCalendarModal .list-group-item {
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
}

#editCalendarModal .list-group-item:hover {
    background-color: #f8f9fa;
    border-left-color: #5a6fd8;
}

#editCalendarModal .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

#editCalendarModal .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

#editCalendarModal .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

#editCalendarModal .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
}

#editCalendarModal .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Arena Settings Modal Styles */
#arenaSettingsModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

#arenaSettingsModal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#arenaSettingsModal .modal-header .btn-close:hover {
    opacity: 1;
}

#arenaSettingsModal .modal-body {
    padding: 1.5rem;
}

#arenaSettingsModal .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

#arenaSettingsModal .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#arenaSettingsModal .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#arenaSettingsModal .form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#arenaSettingsModal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

#arenaSettingsModal .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

#arenaSettingsModal .btn-primary:disabled {
    background: #6c757d;
    transform: none;
}

/* Responsive adjustments for arena settings modal */
@media (max-width: 768px) {
    #arenaSettingsModal .modal-dialog {
        max-width: 95vw;
        margin: 0.5rem auto;
    }
    
    #arenaSettingsModal .modal-body {
        padding: 1rem;
    }
}

/* Arena Settings Saving Indicator */
#arenaSettingsModal .saving-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#arenaSettingsModal .saving-indicator.text-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

#arenaSettingsModal .saving-indicator.text-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

#arenaSettingsModal .saving-indicator.text-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Form element saving states */
#arenaSettingsModal .form-check-input.saving,
#arenaSettingsModal .form-select.saving {
    opacity: 0.6;
    cursor: not-allowed;
}

#arenaSettingsModal .form-check-input.saving + .form-check-label {
    opacity: 0.6;
}

#arenaSettingsModal .form-select.saving {
    background-color: #f8f9fa;
}

/* Google Maps Location Autocomplete Styles */
#location-autocomplete-container {
    margin-bottom: 1rem;
}

#location-autocomplete-container ::part(root) {
    width: 100%;
    box-sizing: border-box;
}

#location-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

#location-results .form-control {
    background-color: #fff;
    border: 1px solid #ced4da;
    font-size: 0.875rem;
}

#location-results .form-control:read-only {
    background-color: #f8f9fa;
    color: #495057;
    cursor: default;
}

/* Database-loaded location styling */
#location-results .form-control[value*="database"] {
    background-color: #e8f5e8;
    border-color: #28a745;
    color: #155724;
    font-style: italic;
}

#location-results .form-label {
    color: #495057;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

/* Google Maps Autocomplete Element Styling */
#location-autocomplete-container ::part(input) {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#location-autocomplete-container ::part(input):focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: 0;
}

/* Current location display styling */
#current-location-display {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

#current-location-display .form-control-plaintext {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
}

#current-location-display .bi-geo-alt {
    color: #28a745;
}

#location-autocomplete-container ::part(suggestions) {
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #fff;
}

#location-autocomplete-container ::part(suggestion) {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

#location-autocomplete-container ::part(suggestion):hover {
    background-color: #f8f9fa;
}

#location-autocomplete-container ::part(suggestion):last-child {
    border-bottom: none;
}



/* Location Saving Indicator Styling */
#location-autocomplete-container .saving-indicator {
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.5rem;
}

#location-autocomplete-container .saving-indicator.text-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
    border: 1px solid rgba(13, 202, 240, 0.2);
}

#location-autocomplete-container .saving-indicator.text-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.2);
}

#location-autocomplete-container .saving-indicator.text-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

#location-autocomplete-container .saving-indicator .bi-hourglass-split {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive adjustments for location fields */
@media (max-width: 768px) {
    #location-results .row .col-6,
    #location-results .row .col-3 {
        margin-bottom: 0.5rem;
    }
    
    #location-results .row .col-12 {
        margin-bottom: 0.75rem;
    }
}

/* Loading and Error States for Google Maps */
#maps-loading {
    color: #6c757d;
    font-size: 0.875rem;
}

#maps-loading .spinner-border {
    width: 1rem;
    height: 1rem;
}

#location-autocomplete-container .alert {
    margin: 0;
    font-size: 0.875rem;
}

#location-autocomplete-container .alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Clear button styling */
#location-results .btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
}

#location-results .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

#location-results .d-flex.gap-1 {
    gap: 0.25rem !important;
}

/* Modal Fallback Styles for Collage Detection */
#collageOptionModal {
    background-color: rgba(0, 0, 0, 0.5);
}

#collageOptionModal.show {
    display: block !important;
}

#collageOptionModal .modal-dialog {
    margin: 1.75rem auto;
    max-width: 800px;
}

#collageOptionModal .modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#collageOptionModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

#collageOptionModal .modal-title {
    color: white;
    font-weight: 600;
}

#collageOptionModal .btn-close {
    filter: invert(1);
}

#collageOptionModal .btn-close:hover {
    opacity: 0.75;
}

#collageOptionModal .btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#collageOptionModal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#collageOptionModal .btn-outline-primary {
    border-width: 2px;
}

#collageOptionModal .btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

#collageOptionModal .btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
}

#collageOptionModal .btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
}

#collageOptionModal .collage-preview-container {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

#collageOptionModal .image-thumbnail {
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

#collageOptionModal .card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#collageOptionModal .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modal backdrop fallback */
#collageModalBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

/* Ensure modal is above backdrop */
#collageOptionModal {
    z-index: 1055;
}

/* Modal Accessibility Fixes */
.modal {
    outline: none !important;
}

.modal:focus {
    outline: none !important;
}

.modal:focus-within {
    outline: none !important;
}

/* Prevent modal from getting focus */
#editContentModal:focus,
#editCalendarModal:focus {
    outline: none !important;
}

#editContentModal:focus-within,
#editCalendarModal:focus-within {
    outline: none !important;
}

/* Template Manager Styles */
.template-manager {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.template-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.template-controls {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.template-editor {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.json-editor {
    min-height: 400px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    resize: vertical;
    background: #f8f9fa;
}

.json-editor:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
    background: white;
}

.template-card {
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.template-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.template-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-template {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-template:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-template.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.btn-template.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.json-validation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    display: none;
    font-weight: 500;
}

.json-validation.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.json-validation.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.history-panel {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid #e9ecef;
}

.history-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.history-item:last-child {
    margin-bottom: 0;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0.75rem;
    border: 2px dashed #dee2e6;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Template Manager Responsive Design */
@media (max-width: 768px) {
    .template-manager {
        padding: 1rem;
    }
    
    .template-header {
        padding: 1.5rem;
    }
    
    .template-controls,
    .template-editor {
        padding: 1.5rem;
    }
    
    .template-card {
        padding: 1rem;
    }
    
    .template-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-template {
        width: 100%;
        text-align: center;
    }
    
    .json-editor {
        min-height: 300px;
        font-size: 12px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Template Manager Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .template-controls,
    .template-editor {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .template-card {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .template-card:hover {
        background: #5a6578;
    }
    
    .template-card.selected {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    }
    
    .json-editor {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .json-editor:focus {
        background: #2d3748;
        border-color: #667eea;
    }
    
    .history-panel {
        background: #4a5568;
        border-color: #718096;
    }
    
    .history-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .empty-state {
        background: #4a5568;
        border-color: #718096;
        color: #a0aec0;
    }
}

/* Ensure form elements don't cause focus issues */
.modal form:focus,
.modal form:focus-within {
    outline: none !important;
}

/* Remove any tabindex that might cause focus issues */
.modal[tabindex] {
    outline: none !important;
}

/* Inline Modal Notifications */
.modal-notification-area {
    display: flex;
    align-items: center;
    min-height: 38px; /* Match button height */
}

.inline-notification {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: fadeInSlide 0.3s ease-out;
}

.inline-notification-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.inline-notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c2c7;
}

.inline-notification i {
    font-size: 1rem;
}

/* Animation for notifications */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ensure notification area doesn't cause layout shifts */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-footer .btn {
    flex-shrink: 0;
}

/* Specific styling for modals without notification areas */
#arenaSettingsModal .modal-footer,
#calendarManagementModal .modal-footer {
    justify-content: flex-end;
}

#arenaSettingsModal .modal-footer .ms-auto,
#calendarManagementModal .modal-footer .ms-auto {
    margin-left: auto;
}

/* Calendar Management Modal Input Styling */
#calendarManagementModal .form-control::placeholder {
    text-align: left !important;
    direction: ltr !important;
}

#calendarManagementModal .form-control {
    text-align: left !important;
}

#calendarManagementModal input[type="text"]::placeholder,
#calendarManagementModal input[type="url"]::placeholder {
    text-align: left !important;
    direction: ltr !important;
}

/* Passed Content Section Styles */
.passed-content-section {
    margin-top: 1rem;
    margin-bottom: 3rem;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    background: #f0f4f8;
    border-radius: 8px;
}

.passed-content-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.passed-content-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

.passed-content-toggle[aria-expanded="true"] {
    background: #e9ecef;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.passed-content-toggle .bi-chevron-down {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.passed-content-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.passed-content-toggle .passed-count {
    background: #adb5bd;
    color: #343a40;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

#passedContentList {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fafafa;
}

#passedContentList .content-list {
    padding: 0.5rem;
}

#passedContentList .content-card {
    opacity: 0.8;
}

#passedContentList .content-card:hover {
    opacity: 1;
}

/* Hide item numbers for passed items */
#passedContentList .content-row::before {
    display: none !important;
}

/* Remove left padding for passed content list (no numbers) */
#passedContentList .content-list {
    padding-left: 0;
    counter-reset: none;
}

/* Fix preview sizing in passed section */
#passedContentList .passed-preview-section {
    display: flex;
    align-items: center;
}

#passedContentList .content-preview {
    width: 80px;
    height: 60px;
    min-width: 80px;
    max-width: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

#passedContentList .content-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#passedContentList .pdf-preview,
#passedContentList .url-preview,
#passedContentList .calendar-preview {
    width: 80px;
    height: 60px;
    min-width: 80px;
    max-width: 80px;
}

/* =====================================================
   Hub Notification Bell Styles
   ===================================================== */

.header-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #fff;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.notification-btn i {
    font-size: 1.75rem;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: white;
    background: #22c55e; /* Green instead of red for less intrusive */
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.notification-dropdown-menu {
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow: hidden;
}

.notification-dropdown-menu .dropdown-header {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.notification-list {
    max-height: 330px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8fafc;
    color: #334155;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 0.5rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #94a3b8;
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}