html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Responsive iframe container for videos (16:9 by default) */
.iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: auto !important; /* ensure iframes cannot block siblings */
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDU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bm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Video responsive wrapper - high specificity to override any other styles */
.video-aspect-ratio-16-9 {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    overflow: hidden !important;
}

.video-aspect-ratio-16-9 iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    isolation: isolate !important;
    pointer-events: auto !important; /* ensure iframes cannot block siblings */
}

/* Force override any inline styles that might be applied by YouTube */
.video-aspect-ratio-16-9 iframe[style] {
    width: 100% !important;
    height: 100% !important;
}

/* Clean video placeholder styling with primary color */
.video-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background-image: 
        linear-gradient(135deg, rgba(81, 216, 155, 0.75) 0%, rgba(132, 78, 240, 0.85) 100%),
        url('/bootstrap/assets/alex-self.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    padding: 2rem !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 12px rgba(89, 74, 226, 0.3) !important;
}

.video-placeholder:hover {
    background-image: 
        linear-gradient(135deg, rgba(85, 227, 163, 0.9) 0%, rgba(122, 103, 231, 0.9) 100%),
        url('/bootstrap/assets/alex-self.jpg') !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(89, 74, 226, 0.4) !important;
}

.video-placeholder .mud-icon-root {
    font-size: 6rem !important;
    color: white !important;
    margin-bottom: 1.5rem !important;
    transition: all 0.3s ease !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) !important;
}

.video-placeholder:hover .mud-icon-root {
    transform: scale(1.1) !important;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3)) !important;
}

.video-placeholder .mud-typography {
    color: white !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    line-height: 1.4 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.video-placeholder:hover .mud-typography {
    transform: translateY(-1px) !important;
}

/* Specific styling for h6 in video placeholder */
.video-placeholder .mud-typography.mud-typography-h6 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.75rem !important;
}

/* Specific styling for body2 in video placeholder */
.video-placeholder .mud-typography.mud-typography-body2 {
    font-size: 1rem !important;
    font-weight: 400 !important;
    opacity: 0.9 !important;
    max-width: 85% !important;
}

.video-placeholder:hover .mud-typography.mud-typography-body2 {
    opacity: 1 !important;
}

/* Ensure proper tab isolation and prevent interference */
.mud-tabs .mud-tab-panel {
    isolation: isolate;
}

/* Ensure iframe does not steal click/drags from tabs */
.mud-tab-panel { position: relative; }
.mud-tab-panel > .video-aspect-ratio-16-9 { pointer-events: none; }
.mud-tab-panel > .video-aspect-ratio-16-9 iframe { pointer-events: auto; }

/* MudCarousel Custom Styling - Using Primary Brand Colors */
.carousel-container {
    position: relative;
    overflow: hidden;
}

/* Define CSS variables for consistent brand colors */
:root {
    --primary-color: #594ae2;
    --primary-color-rgb: 89, 74, 226;
    --primary-dark: #2a0845;
    --primary-dark-rgb: 42, 8, 69;
    --primary-gradient-start: #2a0845;
    --primary-gradient-end: #3a0647;
}

/* Target ALL possible button selectors in the carousel - Using Primary Colors */
.carousel-container button,
.carousel-container .mud-button,
.carousel-container .mud-icon-button,
.carousel-container .mud-carousel button,
.carousel-container .mud-carousel .mud-button,
.carousel-container .mud-carousel .mud-icon-button,
.carousel-container div[role="button"],
.carousel-container button[tabindex] {
    background-color: rgba(var(--primary-color-rgb), 0.3) !important;
    color: transparent !important;
    border: 2px solid rgba(var(--primary-color-rgb), 0.4) !important;
    border-radius: 50% !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin: 0 6px !important;
    padding: 0 !important;
    transition: all 0.3s ease !important;
}

.carousel-container button:hover,
.carousel-container .mud-button:hover,
.carousel-container .mud-icon-button:hover,
.carousel-container .mud-carousel button:hover,
.carousel-container .mud-carousel .mud-button:hover,
.carousel-container .mud-carousel .mud-icon-button:hover,
.carousel-container div[role="button"]:hover,
.carousel-container button[tabindex]:hover {
    background-color: var(--primary-color) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.2) !important;
    box-shadow: 0 0 15px rgba(var(--primary-color-rgb), 0.5) !important;
}

/* Active/Selected state for bullets - Using Primary Color */
.carousel-container button.active,
.carousel-container .mud-button.active,
.carousel-container .mud-icon-button.active,
.carousel-container .mud-button.mud-button-filled,
.carousel-container .mud-button[aria-pressed="true"],
.carousel-container button[aria-pressed="true"],
.carousel-container .mud-carousel button.active,
.carousel-container .mud-carousel .mud-button.active,
.carousel-container .mud-carousel .mud-icon-button.active,
.carousel-container .mud-carousel .mud-button.mud-button-filled,
.carousel-container .mud-carousel .mud-button[aria-pressed="true"],
.carousel-container .mud-carousel button[aria-pressed="true"] {
    background-color: var(--primary-color) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    transform: scale(1.4) !important;
    box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.7) !important;
}

/* Specific styling for navigation arrows (larger buttons) */
.carousel-container button[style*="56px"],
.carousel-container .mud-button[style*="56px"],
.carousel-container button[style*="48px"],
.carousel-container .mud-button[style*="48px"] {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end)) !important;
    color: white !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(5px) !important;
    width: 55px !important;
    height: 55px !important;
    min-width: 55px !important;
    min-height: 55px !important;
    transition: all 0.3s ease !important;
}

.carousel-container button[style*="56px"]:hover,
.carousel-container .mud-button[style*="56px"]:hover,
.carousel-container button[style*="48px"]:hover,
.carousel-container .mud-button[style*="48px"]:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.5) !important;
}

/* Override SVG and icon colors inside carousel buttons */
.carousel-container button svg,
.carousel-container .mud-button svg,
.carousel-container .mud-icon-button svg,
.carousel-container button .mud-icon-root,
.carousel-container .mud-button .mud-icon-root,
.carousel-container .mud-icon-button .mud-icon-root {
    fill: white !important;
    color: white !important;
}

/* Force styling on any MudBlazor component classes */
.carousel-container .mud-carousel-delimiters,
.carousel-container .mud-carousel-elements {
    z-index: 20 !important;
}

.carousel-container .mud-carousel-delimiters {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 12px 24px !important;
    background: linear-gradient(135deg, rgba(var(--primary-dark-rgb), 0.95), rgba(58, 6, 71, 0.95)) !important;
    border-radius: 30px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Ensure carousel content has proper spacing from bullets */
.carousel-container .mud-carousel-item {
    padding-bottom: 80px !important;
}

/* Card content styling to prevent overflow */
.carousel-container .mud-card-content {
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(var(--primary-color-rgb), 0.3) transparent !important;
}

.carousel-container .mud-card-content::-webkit-scrollbar {
    width: 6px !important;
}

.carousel-container .mud-card-content::-webkit-scrollbar-track {
    background: transparent !important;
}

.carousel-container .mud-card-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.4), rgba(var(--primary-dark-rgb), 0.4)) !important;
    border-radius: 3px !important;
}

.carousel-container .mud-card-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.6), rgba(var(--primary-dark-rgb), 0.6)) !important;
}

/* Text wrapping and overflow handling */
.carousel-container .mud-typography {
    word-break: break-word !important;
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
    -ms-hyphens: auto !important;
}

/* Additional nuclear option - target by element type and position */
.carousel-container > div > div > div > button,
.carousel-container > div > div > button,
.carousel-container > div > button {
    background-color: rgba(var(--primary-color-rgb), 0.3) !important;
    border: 2px solid rgba(var(--primary-color-rgb), 0.4) !important;
    border-radius: 50% !important;
}

/* Media query to ensure it works across different screen sizes */
@media (max-width: 768px) {
    .carousel-container button,
    .carousel-container .mud-button {
        background-color: rgba(var(--primary-color-rgb), 0.4) !important;
        border: 2px solid rgba(var(--primary-color-rgb), 0.5) !important;
    }
    
    .carousel-container button:hover,
    .carousel-container .mud-button:hover,
    .carousel-container button.active,
    .carousel-container .mud-button.active {
        background-color: var(--primary-color) !important;
        border-color: white !important;
    }
    
    /* Mobile video placeholder adjustments */
    .video-placeholder .mud-icon-root {
        font-size: 4.5rem !important;
    }
    
    .video-placeholder .mud-typography.mud-typography-h6 {
        font-size: 1.25rem !important;
    }
    
    .video-placeholder .mud-typography.mud-typography-body2 {
        font-size: 0.9rem !important;
        max-width: 90% !important;
    }
    
    .video-placeholder {
        padding: 1.5rem !important;
    }
}

/* Enhanced chat styling and connection handling */
.chat-shell {
    min-height: 70vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

/* Subtle indication during connection instability */
body.connection-unstable .chat-shell {
    opacity: 0.95;
}

body.connection-unstable .chat-shell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(89, 74, 226, 0.5), transparent);
    animation: connection-pulse 2s infinite;
    z-index: 10;
}

@keyframes connection-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.messages-area {
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(89, 74, 226, 0.3) transparent;
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: rgba(89, 74, 226, 0.3);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(89, 74, 226, 0.5);
}

.msg-bubble {
    border-radius: 12px !important;
    word-wrap: break-word;
    hyphens: auto;
}

.assistant-html {
    line-height: 1.5;
}

.assistant-html p {
    margin-bottom: 0.75rem;
}

.assistant-html ul,
.assistant-html ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.assistant-html li {
    margin-bottom: 0.25rem;
}

.assistant-html h1,
.assistant-html h2,
.assistant-html h3,
.assistant-html h4 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.assistant-html code {
    background-color: rgba(89, 74, 226, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.assistant-html pre {
    background-color: rgba(89, 74, 226, 0.05);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.typing {
    width: 60px;
    height: 4px;
}

@media (max-width: 768px) {
    .chat-shell {
        min-height: 65vh;
        max-height: 75vh;
    }
    
    .messages-area {
        max-height: 450px;
    }
    
    .msg-bubble {
        max-width: 90% !important;
    }
}

/* Connection status indicator - less prominent */
.connection-status {
    position: fixed;
    top: 80px; /* Below the navigation */
    right: 20px;
    z-index: 1000;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    max-width: 200px;
}

.connection-status.connected {
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.connection-status.disconnected {
    background-color: rgba(255, 152, 0, 0.9); /* Orange instead of red */
    color: white;
    border: 1px solid rgba(255, 152, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.connection-status.reconnecting {
    background-color: rgba(33, 150, 243, 0.9); /* Blue for reconnecting */
    color: white;
    border: 1px solid rgba(33, 150, 243, 0.3);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

/* Force hide any Blazor error UI that might slip through */
#blazor-error-ui,
div[id*="blazor-error"],
div[class*="blazor-error"],
.blazor-error-boundary,
div[data-blazor-error],
[data-reconnect-modal] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Ensure chat remains functional during any brief connection issues */
.chat-shell.connection-recovering {
    pointer-events: auto;
}

.chat-shell.connection-recovering .input-box {
    background-color: rgba(255, 255, 255, 0.95);
}

/* Enhanced loading states */
.messages-area.loading {
    position: relative;
}

.messages-area.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(89, 74, 226, 0.8), transparent);
    animation: loading-sweep 1.5s infinite;
}

@keyframes loading-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Existing styles continue... */
