:root {
    /* Brand Colors */
    --brand-primary: #1b6ec2;
    --brand-primary-dark: #1861ac;
    --brand-primary-light: rgba(27, 110, 194, 0.1);
    --brand-primary-lighter: rgba(27, 110, 194, 0.05);
    --brand-primary-shadow: rgba(27, 110, 194, 0.3);
    --brand-secondary: #9333ea;
    --brand-secondary-light: rgba(147, 51, 234, 0.1);
    --brand-accent: #f59e0b;
    --brand-accent-light: rgba(245, 158, 11, 0.1);
    --interactive-link: #006bb7;
    --interactive-focus: #258cfb;
    
    /* Surface Colors */
    --surface-dark: #275594;
    --surface-darker: #1a3d6a;
    --surface-medium: #6c757d;
    --surface-light: #f8f9fa;
    --surface-lighter: rgba(255, 255, 255, 0.05);
    --surface-lightest: #ffffff;
    --surface-border: #dee2e6;
    --surface-border-alt: #e9ecef;
    --surface-input: #929292;
    
    /* Status Colors */
    --status-success: #10b981;
    --status-success-light: rgba(16, 185, 129, 0.1);
    --status-error: #e50000;
    --status-error-light: rgba(229, 0, 0, 0.1);
    --status-danger: #dc3545;
    --status-warning: #ffc107;
    
    /* Layout Colors */
    --layout-sidebar-start: rgb(5, 39, 103);
    --layout-sidebar-end: #3a0647;
    --layout-nav-text: #d7d7d7;
    --layout-header-bg: #f7f7f7;
    --layout-border: #d6d5d5;
    
    /* Scrollbar Colors */
    --ui-scrollbar-track: #f1f1f1;
    --ui-scrollbar-thumb: #c1c1c1;
    --ui-scrollbar-thumb-hover: #a8a8a8;
    
    /* Text Colors */
    --text-primary: #292f38;
    --text-secondary: #6c757d;
    --text-muted: #999999;
    --text-light: #d7d7d7;
    --text-inverse: #fff;

    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px - Extra small (captions, labels) */
    --font-size-sm: 0.875rem;     /* 14px - Small (metadata, secondary text) */
    --font-size-base: 0.9rem;       /* 16px - Base (body text, default) */
    --font-size-md: 1.0rem;     /* 18px - Medium (emphasized text) */
    --font-size-lg: 1.125rem;      /* 20px - Large (subheadings) */
    --font-size-xl: 1.25rem;       /* 24px - Extra large (headings) */
    --font-size-2xl: 1.8rem;        /* 32px - 2X large (page titles) */
    --font-size-3xl: 2.2rem;      /* 40px - 3X large (hero titles) */
    
    /* Base Colors */
    --base-white: #fff;
    
    /* Overlay Colors */
    --overlay-backdrop: rgba(0, 0, 0, 0.5);
    --overlay-dark: rgba(0, 0, 0, 0.2);
    --overlay-darker: rgba(0, 0, 0, 0.4);
    --overlay-light: rgba(255, 255, 255, 0.1);
    --overlay-lighter: rgba(255, 255, 255, 0.15);
    
    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.3);
    
    /* Typography */
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a, .btn-link {
    color: var(--interactive-link);
}

.btn-primary {
    color: var(--text-inverse);
    background-color: var(--brand-primary);
    border-color: var(--brand-primary-dark);
}

.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 var(--interactive-focus);
}

.content {
    padding: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--status-success);
}

.invalid {
    outline: 1px solid var(--status-error);
}

.validation-message {
    color: var(--status-error);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAt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ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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: var(--surface-input);
}

/* Style Guide Specific Styles */
.style-guide {
    padding: 2rem 0;
    background-color: var(--base-white);
    min-height: 100vh;
}

.style-guide-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--surface-border);
}

.style-guide-header h1 {
    color: var(--text-primary);
    font-weight: 600;
}

.style-section {
    margin-bottom: 4rem;
    padding: 2rem;
    background-color: var(--surface-light);
    border-radius: 1rem;
    border: 1px solid var(--surface-border);
}

.style-section h2 {
    color: var(--brand-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.style-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Color Palette */
.color-palette {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid var(--surface-border);
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--surface-border);
    flex-shrink: 0;
}

.color-info strong {
    color: var(--text-primary);
}

.color-info code {
    background-color: var(--surface-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.color-info small {
    color: var(--text-secondary);
}

/* Typography and Examples */
.typography-example,
.button-examples,
.chat-preview,
.responsive-info {
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid var(--surface-border);
    margin-bottom: 1rem;
}

.typography-hierarchy {
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid var(--surface-border);
}

.typography-hierarchy h1,
.typography-hierarchy h2,
.typography-hierarchy h3,
.typography-hierarchy h4,
.typography-hierarchy h5 {
    margin-bottom: 0.5rem;
}

.chat-preview {
    max-height: 400px;
    overflow-y: auto;
}

/* Header Example Styles */
.header-example {
    margin-bottom: 1rem;
}

.chat-header {
    background-color: var(--surface-dark);
    color: white;
    border-bottom: 1px solid var(--surface-border);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.chat-title {
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.chat-title i {
    color: var(--brand-accent);
}

.header-btn {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
}

/* Mobile Safe Area Support */
.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: var(--layout-header-bg);
        width: 100%;
        z-index: 1;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

/* New Components - Cards, Progress, Timer, Profiles */

/* Base Card Component */
.style-card {
    background: var(--base-white);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.style-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.style-card-header {
    background: var(--surface-light);
    border-bottom: 1px solid var(--surface-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.style-card-body {
    padding: 1.25rem;
    color: var(--text-primary);
}

/* Profile Card Component */
.profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--base-white);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

.profile-card:hover {
    background: var(--surface-light);
    border-color: var(--brand-primary);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 32px;
    position: relative;
}

/* Avatar background element */
.avatar-background {
    position: absolute;
    width: 110%;
    height: 110%;
    border-radius: 20%;
    /* width: 100%;
    height: 100%;
    border-radius: 50%; */
    z-index: 1;
}

/* Avatar image styles - maintain aspect ratio without cropping */
.profile-avatar img {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    object-fit: contain;
    object-position: center;
}

/* User avatar - orange background */
.profile-avatar.user-avatar .avatar-background {
    background-color: var(--brand-primary);
}

/* Actor avatar - blue background */
.profile-avatar.actor-avatar .avatar-background {
    background-color: var(--brand-secondary-light);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.3;
}

.profile-role {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Progress Steps Component */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: calc(100% + 1rem);
    width: 2rem;
    height: 2px;
    background: var(--surface-border);
    z-index: 1;
}

.progress-step.completed:not(:last-child)::after {
    background: var(--status-success);
}

.progress-step.active:not(:last-child)::after {
    background: linear-gradient(to right, var(--brand-primary) 50%, var(--surface-border) 50%);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    z-index: 2;
    background: var(--surface-light);
    border: 2px solid var(--surface-border);
    color: var(--text-secondary);
}

.progress-step.completed .step-number {
    background: var(--status-success);
    border-color: var(--status-success);
    color: white;
}

.progress-step.active .step-number {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.progress-step.active .step-label {
    color: var(--brand-primary);
    font-weight: 600;
}

/* Timer Component */
.timer-component {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.timer-circle {
    width: 120px;
    height: 120px;
    border: 4px solid var(--surface-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--base-white);
}

.timer-circle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 4px solid var(--brand-accent);
    border-radius: 50%;
    border-top-color: transparent;
    border-right-color: transparent;
    transform: rotate(-90deg);
    z-index: 1;
}

.timer-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.timer-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.timer-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .style-guide {
        padding: 1rem 0;
    }
    
    .style-section {
        margin-bottom: 2rem;
        padding: 1rem;
    }
    
    .color-item {
        flex-direction: column;
        text-align: center;
    }
    
    .progress-steps {
        gap: 1rem;
    }
    
    .progress-step:not(:last-child)::after {
        width: 1rem;
        left: calc(100% + 0.5rem);
    }
    
    .timer-circle {
        width: 100px;
        height: 100px;
    }
    
    .timer-value {
        font-size: 1.1rem;
    }
    
    .profile-card {
        padding: 0.5rem 0.75rem;
    }
    
    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    /* Ensure avatar background and images maintain aspect ratio on mobile */
    .avatar-background {
        width: 100%;
        height: 100%;
    }

    .profile-avatar img {
        width: 100%;
        height: 100%;
    }
}

/* Training Layout - 3 Column System */
.training-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-light);
}

.training-header {
    background: var(--surface-dark);
    color: var(--text-inverse);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.training-title {
    font-weight: 600;
    display: flex;
    align-items: center;
}

.training-title i {
    color: var(--brand-accent);
}

.training-content {
    flex: 1;
    display: grid;
    grid-template-columns: 400px 1fr 400px;
    gap: 1rem;
    padding: 1.5rem;
    max-height: calc(100vh - 60px);
    overflow: hidden;
}

.training-sidebar-left {
    background: var(--base-white);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    border: 1px solid var(--surface-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.training-sidebar-right {
    background: var(--base-white);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    border: 1px solid var(--surface-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.training-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0;
}

.participants-section {
    flex-shrink: 0;
    background: var(--base-white);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--surface-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-container {
    flex: 1;
    background: var(--base-white);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

.chat-input-area {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid var(--surface-border);
    background: var(--surface-light);
    border-radius: 0 0 8px 8px;
}

.training-brand {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
    text-align: center;
}

/* Responsive Design per Training Layout */
@media (max-width: 1400px) {
    .training-content {
        grid-template-columns: 280px 1fr 260px;
    }
}

@media (max-width: 1200px) {
    .training-content {
        grid-template-columns: 250px 1fr;
        gap: 0;
    }

    .training-sidebar-right {
        display: none;
    }
}

@media (max-width: 968px) {
    .training-content {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }

    .training-sidebar-left {
        order: 2;
        max-height: 400px;
    }

    .training-main {
        order: 1;
    }

    .participants-section .d-flex {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .training-header {
        padding: 0.5rem;
    }

    .training-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .training-sidebar-left,
    .training-sidebar-right,
    .participants-section,
    .chat-container {
        padding: 0.75rem;
    }
}
