/**
 * Premium Futuristic Dark-Glassmorphism Styling for Onsite Event Booking (local_booking_ultra).
 *
 * Designed with a deep-space background gradient, translucent panels, neon glows, 
 * sleek custom form elements, full print media, and premium micro-animations.
 *
 * @package    local_booking_ultra
 * @copyright  2026 Suman Kumar Das and Digital Tricksters
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/* Core Space & Glass Theme Tokens */
:root {
    --bu-bg-dark: #070c19;
    --bu-primary-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #d946ef 100%);
    --bu-accent-grad: linear-gradient(135deg, #a855f7 0%, #22d3ee 100%);
    
    --bu-card-bg: rgba(13, 22, 47, 0.45);
    --bu-card-bg-hover: rgba(20, 30, 65, 0.6);
    --bu-border-glass: rgba(255, 255, 255, 0.08);
    --bu-border-glass-hover: rgba(255, 255, 255, 0.15);
    
    --bu-glow-blue: 0 0 15px rgba(99, 102, 241, 0.4);
    --bu-glow-purple: 0 0 20px rgba(168, 85, 247, 0.5);
    --bu-glow-cyan: 0 0 15px rgba(34, 211, 238, 0.4);
    
    --bu-text-title: #f8fafc;
    --bu-text-body: #e2e8f0;
    --bu-text-muted: #94a3b8;
    
    --bu-success: #10b981;
    --bu-success-glow: 0 0 15px rgba(16, 185, 129, 0.35);
    --bu-warning: #f59e0b;
    --bu-danger: #f43f5e;
    --bu-danger-glow: 0 0 15px rgba(244, 63, 94, 0.35);
}

/* Dashboard Container Layout */
.bu-dashboard {
    background: radial-gradient(circle at 50% 50%, #0c1530 0%, #030712 100%);
    border-radius: 24px;
    padding: 35px;
    border: 1px solid var(--bu-border-glass);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--bu-text-body);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin-bottom: 40px;
    overflow: hidden;
    position: relative;
}

/* Deep Space Glowing Backdrops */
.bu-dashboard::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 350px;
    height: 350px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
}

.bu-dashboard::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 350px;
    height: 350px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
}

/* Header Section */
.bu-header {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bu-border-glass);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(12px);
    margin-bottom: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 0 !important;
}

.bu-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #ffffff, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bu-header p {
    margin: 6px 0 0 0;
    color: var(--bu-text-muted);
    font-size: 1.05rem;
}

.bu-btn-header {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 700;
    border: 1px solid var(--bu-border-glass);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bu-btn-header:hover {
    background: var(--bu-primary-grad);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--bu-glow-purple);
}

/* Dashboard Grid Layout */
.bu-grid-dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    z-index: 1;
}

@media (min-width: 1200px) {
    .bu-grid-dashboard {
        flex-direction: row;
    }
    .bu-grid-dashboard > :first-child {
        flex: 1.6;
        min-width: 0;
    }
    .bu-grid-dashboard > :last-child {
        flex: 1.4;
        min-width: 0;
    }
}

/* Glassmorphic Card Panel */
.bu-dashboard .bu-card {
    background: #0d162f !important;
    border: 1px solid var(--bu-border-glass) !important;
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: #e2e8f0 !important;
    position: relative !important;
    z-index: 2 !important;
}

.bu-card:hover {
    border-color: var(--bu-border-glass-hover);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.bu-card-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--bu-text-title);
    border-bottom: 1px solid var(--bu-border-glass);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bu-card-title i {
    color: #a855f7;
}

/* Slot catalog list */
.bu-slots-catalog {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Premium Slot Item Card */
.bu-dashboard .bu-slot-item-card {
    background: #111a36 !important;
    border: 1px solid var(--bu-border-glass) !important;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    gap: 20px;
    color: #e2e8f0 !important;
}

/* Specific high-contrast text overrides to prevent theme backdrop conflicts */
.bu-dashboard h1,
.bu-dashboard h2,
.bu-dashboard h3,
.bu-dashboard h4,
.bu-dashboard h5,
.bu-dashboard h6 {
    color: #f8fafc !important;
}

.bu-dashboard p,
.bu-dashboard span,
.bu-dashboard div,
.bu-dashboard label,
.bu-dashboard td,
.bu-dashboard th,
.bu-dashboard strong {
    color: #e2e8f0 !important;
}

.bu-dashboard .text-muted,
.bu-dashboard .small,
.bu-dashboard small {
    color: #94a3b8 !important;
}

.bu-dashboard .text-success,
.bu-dashboard .text-success * {
    color: #10b981 !important;
}

.bu-dashboard .text-danger,
.bu-dashboard .text-danger * {
    color: #f43f5e !important;
}

.bu-dashboard .text-primary,
.bu-dashboard .text-primary * {
    color: #c084fc !important;
}

.bu-dashboard .bu-slot-item-card:hover {
    background: #152248 !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
}

.bu-slot-info {
    flex: 1;
}

.bu-slot-price-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bu-accent-grad);
    color: #070c19;
    padding: 5px 16px;
    font-size: 0.85rem;
    font-weight: 800;
    border-bottom-left-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bu-slot-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    padding-right: 90px;
    color: var(--bu-text-title);
}

.bu-slot-desc {
    font-size: 0.95rem;
    color: var(--bu-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.bu-slot-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 25px;
    font-size: 0.92rem;
    color: var(--bu-text-body);
}

.bu-slot-details-grid div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bu-slot-details-grid i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .bu-slot-item-card {
        flex-direction: column;
        align-items: stretch;
    }
    .bu-slot-details-grid {
        grid-template-columns: 1fr;
    }
}

.bu-slot-action {
    min-width: 170px;
    display: flex;
    align-items: center;
}

/* Premium Buttons */
.bu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 99px;
    font-weight: 700;
    text-decoration: none !important;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.bu-btn-primary {
    background: var(--bu-primary-grad);
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.25);
}

.bu-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--bu-glow-purple);
}

.bu-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bu-text-body) !important;
    border: 1px solid var(--bu-border-glass);
}

.bu-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--bu-border-glass-hover);
}

.bu-btn-danger {
    background: var(--bu-danger);
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.2);
}

.bu-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--bu-danger-glow);
}

.bu-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Badges */
.bu-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.bu-badge-pending { 
    background: rgba(245, 158, 11, 0.15) !important; 
    color: #f59e0b !important; 
    border-color: rgba(245, 158, 11, 0.3) !important; 
}
.bu-badge-confirmed { 
    background: rgba(16, 185, 129, 0.15) !important; 
    color: #10b981 !important; 
    border-color: rgba(16, 185, 129, 0.3) !important; 
}
.bu-badge-cancelled { 
    background: rgba(244, 63, 94, 0.15) !important; 
    color: #f43f5e !important; 
    border-color: rgba(244, 63, 94, 0.3) !important; 
}
.bu-badge-unpaid { 
    background: rgba(249, 115, 22, 0.15) !important; 
    color: #f97316 !important; 
    border-color: rgba(249, 115, 22, 0.3) !important; 
}
.bu-badge-paid { 
    background: rgba(16, 185, 129, 0.15) !important; 
    color: #10b981 !important; 
    border-color: rgba(16, 185, 129, 0.3) !important; 
}
.bu-badge-waiting { 
    background: rgba(99, 102, 241, 0.15) !important; 
    color: #818cf8 !important; 
    border-color: rgba(99, 102, 241, 0.3) !important; 
}

/* Table Styling */
.bu-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--bu-text-body);
}

.bu-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--bu-border-glass);
    padding: 16px 12px;
    font-weight: 700;
    text-align: left;
    color: var(--bu-text-title);
}

.bu-table td {
    border-bottom: 1px solid var(--bu-border-glass);
    padding: 16px 12px;
    vertical-align: middle;
}

.bu-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Custom overlay modal (Out-Of-This-World overlay) */
.bu-custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bu-custom-modal-content {
    background: #0d152c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    box-shadow: var(--bu-glow-purple), 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    animation: buModalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--bu-text-body);
}

@keyframes buModalSlideIn {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.bu-modal-header {
    background: var(--bu-primary-grad);
    color: #ffffff;
    padding: 22px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bu-modal-header h3 {
    margin: 0;
    color: #ffffff !important;
    font-size: 1.4rem;
    font-weight: 800;
}

.bu-modal-close {
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    color: #ffffff;
}

.bu-modal-close:hover {
    opacity: 1;
    transform: scale(1.15);
}

.bu-modal-body {
    padding: 30px;
}

.bu-modal-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bu-border-glass);
    border-radius: 12px;
    padding: 20px;
    font-size: 0.95rem;
    border-left: 4px solid #c084fc;
    color: var(--bu-text-body);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Booked Sessions layout */
.bu-my-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bu-booking-ticket {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--bu-border-glass-hover);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.25s ease;
}

.bu-booking-ticket:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* Modern Glass Alerts */
.bu-alert {
    border-radius: 16px;
    padding: 20px 25px;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.bu-alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: var(--bu-success-glow);
}

.bu-alert-danger {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.25);
    box-shadow: var(--bu-danger-glow);
}

/* Premium Form Elements */
.bu-dashboard .form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bu-border-glass);
    border-radius: 10px;
    color: #ffffff;
    padding: 12px 16px;
    transition: all 0.25s ease;
}

.bu-dashboard .form-control:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.bu-dashboard .form-control::placeholder {
    color: var(--bu-text-muted);
}

/* Floating Action Button (FAB) */
.bu-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bu-primary-grad);
    color: #ffffff !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    white-space: nowrap;
}

.bu-fab i {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.bu-fab-label {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    font-weight: 700;
    font-size: 0.95rem;
    transition: max-width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    font-family: sans-serif;
}

.bu-fab:hover {
    width: 220px;
    border-radius: 30px;
    transform: translateY(-4px);
    box-shadow: var(--bu-glow-purple);
    padding: 0 20px;
    justify-content: flex-start;
}

.bu-fab:hover i {
    transform: rotate(15deg);
}

.bu-fab:hover .bu-fab-label {
    max-width: 150px;
    opacity: 1;
    margin-left: 10px;
}

/* Print Ticket pass layout (boarding pass layout) */
.bu-ticket-container {
    max-width: 600px;
    margin: 40px auto;
    background: #0d152c;
    border-radius: 24px;
    box-shadow: var(--bu-glow-purple), 0 15px 45px rgba(0,0,0,0.5);
    overflow: hidden;
    font-family: monospace;
    border: 1px solid var(--bu-border-glass-hover);
    position: relative;
    color: var(--bu-text-body);
}

.bu-ticket-header {
    background: var(--bu-primary-grad);
    color: #ffffff;
    padding: 30px;
    text-align: center;
}

.bu-ticket-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff !important;
}

.bu-ticket-header p {
    margin: 6px 0 0 0;
    opacity: 0.85;
}

.bu-ticket-body {
    padding: 35px;
    position: relative;
}

.bu-ticket-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--bu-border-glass);
    padding-bottom: 10px;
}

.bu-ticket-label {
    font-weight: 700;
    color: var(--bu-text-muted);
}

.bu-ticket-value {
    font-weight: bold;
    color: var(--bu-text-title);
}

.bu-ticket-barcode {
    text-align: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed rgba(168, 85, 247, 0.4);
}

.bu-barcode-line {
    display: inline-block;
    background: #ffffff;
    height: 60px;
    margin: 0 1.5px;
}

.bu-barcode-text {
    margin-top: 8px;
    font-weight: bold;
    letter-spacing: 6px;
    color: var(--bu-text-title);
}

.bu-ticket-instructions {
    font-family: sans-serif;
    font-size: 0.85rem;
    color: var(--bu-text-muted);
    text-align: center;
    margin-top: 25px;
    line-height: 1.5;
}

/* Social share icon premium micro-animations */
.bu-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    font-size: 0.75rem;
    text-decoration: none !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}

.bu-share-icon:hover {
    transform: scale(1.22) translateY(-2px);
    background: rgba(255,255,255,0.15) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Custom monthly calendar styles */
.table-responsive table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.table-responsive table td {
    transition: background 0.2s ease-in-out;
}
.table-responsive table td:hover {
    background: rgba(255,255,255,0.02) !important;
}

/* Force readable table header styles across all Moodle themes */
.bu-dashboard table th,
.bu-dashboard thead th,
.bu-dashboard tr th,
.bu-dashboard table.bu-table thead th,
.bu-dashboard .bu-table thead th {
    background: #111a36 !important;
    color: #f8fafc !important;
    border-bottom: 1px solid var(--bu-border-glass) !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
}

/* Event Catalog Card Banner & Layout styling */
.bu-event-card-banner {
    height: 140px;
    background: linear-gradient(135deg, var(--bu-theme-color-primary) 0%, var(--bu-theme-color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.bu-event-card-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.bu-slot-item-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.bu-slot-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.sticky-top {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
}

/* Prevent overrides from leaking into Moodle Rich Text Editors (Atto / TinyMCE) Toolbar and Menus */
.bu-dashboard .editor_atto_toolbar,
.bu-dashboard .editor_atto_toolbar *,
.bu-dashboard .tox-toolbar,
.bu-dashboard .tox-toolbar *,
.bu-dashboard .tox-menubar,
.bu-dashboard .tox-menubar *,
.bu-dashboard .tox-menu,
.bu-dashboard .tox-menu *,
.bu-dashboard .tox-dialog,
.bu-dashboard .tox-dialog *,
.bu-dashboard .tox-button,
.bu-dashboard .tox-button * {
    color: #333333 !important;
}

/* Premium styling for Bootstrap/Moodle input group prepend labels */
.bu-dashboard .input-group-text {
    background-color: #111a36 !important;
    border-color: var(--bu-border-glass) !important;
    color: var(--bu-text-muted) !important;
}

/* Beautiful responsive scaling for description images */
.bu-event-description img {
    max-width: 100% !important;
    height: auto !important;
    max-height: 450px !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    margin: 18px 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
    border: 1px solid var(--bu-border-glass) !important;
    display: block !important;
}

/* Force TinyMCE dropdown menus and tooltips to render above dashboard overlays */
.tox-tinymce-aux, 
.tox-menu,
.tox {
    z-index: 1000000 !important;
}
