* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-dialog {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.modal-message {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', sans-serif;
}

.modal-cancel {
    background: #f5f5f5;
    color: #666;
}

.modal-cancel:hover {
    background: #e8e8e8;
}

.modal-confirm {
    background: #BF3143;
    color: white;
}

.modal-confirm:hover {
    background: #a02838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(191, 49, 67, 0.3);
}

@media (max-width: 480px) {
    .modal-dialog {
        padding: 24px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #FAFAFA;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Map Background */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background-color: #FAFAFA;
}

.world-map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: mapZoomPan 120s linear infinite;
}

.world-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    /* Duplicate map side by side for seamless loop */
    background-image: url('index3-map.svg'), url('index3-map.svg');
    background-size: 50% auto, 50% auto;
    background-position: 0 center, 100% center;
    background-repeat: no-repeat;
    /* Match the subtle look of the reference page */
    opacity: 0.4;
    filter: grayscale(100%) brightness(1.1);
    pointer-events: none;
}

@keyframes mapZoomPan {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Active User Dots */
#dots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Dots are now inside .world-map so they move with the animation */
}

.user-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #BF3143;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
    transition: transform 0.2s ease;
    z-index: 200;
    pointer-events: auto;
}

.user-dot:hover {
    transform: translate(-50%, -50%) scale(1.5);
    animation: none;
}

/* Hide map dots on mobile (decorative-only, adds noise without value). */
@media (max-width: 768px) {
    .user-dot { display: none; }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(191, 49, 67, 0.4);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 0 8px rgba(191, 49, 67, 0);
    }
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    min-width: 220px;
    max-width: 280px;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 6px;
}

.tooltip-languages {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.tooltip-interests {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* Center Container */
.center-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
    pointer-events: none;
}

/* Card */
.card {
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
    transition: box-shadow 0.3s ease;
    pointer-events: auto;
    cursor: move;
    position: relative;
}

.card.dragging {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    cursor: grabbing;
}

.card-drag-handle {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #E5E5E5;
    border-radius: 2px;
    cursor: grab;
}

.card-drag-handle:active {
    cursor: grabbing;
}

.card-content {
    transition: opacity 0.3s ease;
}

.card-content.hidden {
    display: none;
    opacity: 0;
}

.card-content.fade-out {
    opacity: 0;
}

.card-content.fade-in {
    opacity: 1;
}

/* Header with Profile Link */
.header-with-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
    position: relative;
}

.header-with-profile .card-title {
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 0;
}

.profile-link,
.signout-link,
.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: #666;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.close-btn {
    position: absolute;
    right: 0;
    top: 0;
}

.profile-link:hover,
.signout-link:hover,
.close-btn:hover {
    background: #f5f5f5;
    color: #BF3143;
}

.profile-link svg,
.signout-link svg,
.close-btn svg {
    stroke: currentColor;
}

/* Card Title */
.card-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.3;
}

.beta-badge {
    display: inline-block;
    color: #888;
    font-size: 16px;
    font-weight: 600;
    margin-left: 8px;
}

.live-badge {
    display: inline-block;
    color: #BF3143;
    font-size: 16px;
    font-weight: 600;
}

/* Language Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.language-btn {
    height: 56px;
    border-radius: 12px;
    background: white;
    border: 1px solid #DDDDDD;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.language-btn:hover {
    background: #FAFAFA;
    border-color: #CFCFCF;
}

.language-btn:active {
    transform: scale(0.98);
}

/* Request Link */
.request-link {
    display: block;
    text-align: center;
    color: #333;
    font-size: 14px;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.request-link:hover {
    color: #BF3143;
}

/* Level Buttons */
.level-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.level-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 20px;
    border-radius: 12px;
    background: white;
    border: 1px solid #DDDDDD;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
}

.level-btn:hover {
    background: #FAFAFA;
    border-color: #CFCFCF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.level-btn:active {
    transform: scale(0.98);
}

.level-btn.disabled,
.level-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F7F7F8;
    border-color: #E5E5E7;
}

.level-btn.disabled:hover,
.level-btn:disabled:hover {
    background: #F7F7F8;
    border-color: #E5E5E7;
    box-shadow: none;
    transform: none;
}

.level-btn.disabled .level-name,
.level-btn:disabled .level-name {
    color: #A1A1A6;
}

.level-btn.disabled .level-badge,
.level-btn:disabled .level-badge {
    background: #E5E5E7;
    color: #A1A1A6;
}

.level-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.level-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
}

.level-duration {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.level-description {
    font-size: 13px;
    color: #8E8E93;
    font-style: italic;
    line-height: 1.4;
}

.level-badge {
    background: #F4F4F4;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
}

/* Back Link */
.back-link {
    display: block;
    text-align: center;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #BF3143;
}

/* Interest Selection Styles */
.interest-subtitle {
    text-align: center;
    color: #666;
    font-size: 15px;
    margin: -16px 0 24px 0;
}

.interests-grid {
    display: grid;
    grid-template-columns: repeat(2, 150px);
    gap: 16px;
    margin-bottom: 24px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
    justify-content: center;
}

.interest-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: #333;
    width: 150px;
    height: 100px;
}

.interest-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

.interest-name {
    font-size: 13px;
    font-weight: 500;
    display: block;
    line-height: 1.2;
}

.interest-chip:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.interest-chip.selected {
    background: #fff;
    border-color: #BF3143;
    color: #BF3143;
}

.interest-chip.selected:hover {
    background: #fff;
    border-color: #BF3143;
}

@media (max-width: 768px) {
    .interests-grid {
        grid-template-columns: repeat(2, 140px);
        gap: 12px;
        max-height: 350px;
    }
    
    .interest-chip {
        padding: 12px 8px;
        width: 140px;
        height: 90px;
    }
    
    .interest-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .interest-name {
        font-size: 12px;
    }
}

/* Tutorial Video Styles */
.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 80px 20px;
    margin: 24px 0;
    color: #999;
    min-height: 200px;
}

.video-placeholder svg {
    width: 120px;
    height: 120px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.video-placeholder:hover svg {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Join Prompt Styles */
.join-message {
    text-align: center;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 32px 0;
    padding: 0 20px;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: #BF3143;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    text-align: center;
}

.primary-btn:hover {
    background: #a52938;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(191, 49, 67, 0.3);
}

.secondary-link {
    display: block;
    text-align: center;
    color: #666;
    font-size: 15px;
    text-decoration: none;
    margin-top: 16px;
    transition: color 0.2s ease;
}

.secondary-link:hover {
    color: #BF3143;
}

/* Matching Screen */
#matching-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#matching-screen.hidden {
    display: none;
}

.matching-container {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.matching-content {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.matching-spinner {
    margin-bottom: 32px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #BF3143;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.matching-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.matching-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.matching-timer {
    font-size: 24px;
    font-weight: 700;
    color: #BF3143;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.matching-info {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.matching-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.matching-detail:not(:last-child) {
    border-bottom: 1px solid #E5E5E5;
}

.detail-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 600;
}

.cancel-matching-btn {
    background: white;
    color: #666;
    border: 2px solid #E5E5E5;
    padding: 12px 32px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-matching-btn:hover {
    background: #F7F7F8;
    border-color: #BF3143;
    color: #BF3143;
}

/* Video Chat Interface */
.video-chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f5f5f7;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.video-chat-container.hidden {
    display: none;
}

/* Header */
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: white;
    border-bottom: 1px solid #e5e5e5;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 0;
}

.header-btn {
    background: white;
    border: 1px solid #E5E5E7;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4A4A4D;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.header-btn:hover {
    background: #F7F7F8;
    border-color: #A1A1A6;
}

.timer-btn {
    cursor: default;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}

.timer-btn:hover {
    background: white;
    border-color: #E5E5E7;
}

.leave-btn {
    background: white;
    color: #BF3143;
    border-color: #BF3143;
}

.leave-btn svg {
    stroke: #BF3143;
}

.leave-btn:hover {
    background: #FFF6F7;
}

.video-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.partner-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: color 0.2s ease;
}

.partner-name:hover {
    color: #BF3143;
    text-decoration: underline;
}

.session-count {
    font-size: 14px;
    color: #666;
}

/* Favorite Button */
.favorite-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: relative;
}

.favorite-btn svg {
    transition: all 0.2s ease;
    stroke: #999;
}

.favorite-btn:hover {
    background: rgba(191, 49, 67, 0.1);
}

.favorite-btn:hover svg {
    stroke: #BF3143;
}

.favorite-btn.favorited svg {
    fill: #BF3143;
    stroke: #BF3143;
}

.favorite-btn.favorited:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* Favorite Tooltip - Focusmate Style */
.favorite-tooltip {
    position: absolute;
    bottom: -35px;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.favorite-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: #2c3e50;
    transform: rotate(45deg);
}

.favorite-btn:hover .favorite-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Video Grid */
.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}

.video-panel {
    background: white;
    border: 2px solid #d1d1d1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    position: relative;
}

/* Video name container with mute indicator */
.video-name-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
}

/* Mute indicator */
.mute-indicator {
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: fadeIn 0.2s ease-out;
}

.mute-indicator svg {
    width: 18px;
    height: 18px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.video-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    text-decoration: underline;
}

/* Bottom Controls */
.video-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 30px 40px;
    background: white;
    border-top: 1px solid #e5e5e5;
}

.control-btn {
    background: white;
    border: 1px solid #d1d1d1;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 15px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 110px;
}

.control-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.control-btn[data-active="false"] {
    color: #666;
    border-color: #d1d1d1;
}

.control-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    position: relative;
}

.control-label {
    font-size: 15px;
}

/* Icon wrapper for crossed-out effect */
.icon-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Red slash for disabled state */
.control-btn[data-active="false"] .icon-slash {
    display: block;
}

.icon-slash {
    display: none;
    position: absolute;
    width: 28px;
    height: 2px;
    background: #ff4757;
    transform: rotate(-45deg);
    z-index: 1;
}

.ai-btn {
    background: #BF3143;
    color: white;
    border-color: #BF3143;
    font-weight: 500;
}

.ai-btn:hover {
    background: #A02638;
    border-color: #A02638;
}

.ai-btn .control-icon {
    stroke: white;
}

.ai-btn[data-active="true"] {
    background: #BF3143;
    color: white;
    border-color: #BF3143;
    box-shadow: 0 0 0 3px rgba(191, 49, 67, 0.2);
}

.ai-btn[data-active="true"]:hover {
    background: #A02638;
    border-color: #A02638;
}

.ai-btn[data-active="false"] {
    background: #BF3143;
    color: white;
    border-color: #BF3143;
    opacity: 1;
}

.ai-btn[data-active="false"] .control-icon {
    stroke: white;
}

.ai-btn[data-active="false"]:hover {
    background: #A02638;
    border-color: #A02638;
}

/* AI Chat Box */
.ai-chat-box {
    position: fixed;
    width: 320px;
    height: 450px;
    background: white;
    border: 2px solid #d1d1d1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 300;
    display: flex;
    flex-direction: column;
    right: 40px;
    bottom: 120px;
}

.ai-chat-box.hidden {
    display: none;
}

.chat-header,
.channel-header {
    padding: 16px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-radius: 14px 14px 0 0;
}

.chat-title,
.channel-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.popout-btn,
.close-chat-btn,
.close-channel-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.popout-btn svg,
.close-chat-btn svg,
.close-channel-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.popout-btn:hover {
    background: #d4e5ff;
    color: #0066cc;
}

.close-chat-btn:hover,
.close-channel-btn:hover {
    background: #e5e5e5;
}

.chat-messages,
.channel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.4;
}

.ai-message {
    background: #F7F7F8;
    border: 1px solid #E5E5E7;
    align-self: flex-start;
}

.ai-message strong {
    color: #BF3143;
    font-weight: 600;
}

.user-message {
    background: #BF3143;
    color: white;
    align-self: flex-end;
}

/* Loading message animation */
.loading-message {
    opacity: 0.7;
}

.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: loadingDot 1.4s infinite;
    display: inline-block;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Error message */
.error-message {
    color: #D64545;
    padding: 6px;
    font-size: 14px;
    margin-top: 6px;
    text-align: center;
    background: none;
    border: none;
}

.system-message {
    background: #e8f4f8;
    color: #666;
    align-self: center;
    font-size: 12px;
    padding: 6px 12px;
}

/* AI Quick Actions */
.ai-quick-actions {
    padding: 12px 16px;
    border-top: 1px solid #E5E5E7;
    display: flex;
    gap: 8px;
    background: #F7F7F8;
}

.quick-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: #FFFFFF;
    border: 1px solid #E5E5E7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    color: #4A4A4D;
}

.quick-action-btn svg {
    width: 20px;
    height: 20px;
    stroke: #4A4A4D;
    transition: stroke 0.2s ease;
}

.quick-action-btn:hover {
    background: #BF3143;
    border-color: #BF3143;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 49, 67, 0.2);
}

.quick-action-btn:hover svg {
    stroke: #FFFFFF;
}

.quick-action-btn:active {
    transform: translateY(0);
}

.chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.chat-input:focus {
    border-color: #BF3143;
}

.send-btn {
    background: #BF3143;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.send-btn:hover {
    background: #a02838;
}

/* Message Channel */
.message-channel {
    position: fixed;
    width: 360px;
    height: 500px;
    background: white;
    border: 2px solid #d1d1d1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 300;
    display: flex;
    flex-direction: column;
    right: 40px;
    bottom: 120px;
}

.message-channel.hidden {
    display: none;
}

/* Help Menu */
.help-menu {
    position: absolute;
    top: 60px;
    left: 140px;
    background: white;
    border: 1px solid #d1d1d1;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    min-width: 250px;
}

.help-menu.hidden {
    display: none;
}

.help-menu-item {
    width: 100%;
    padding: 14px 16px;
    background: white;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.help-menu-item:hover {
    background: #f8f8f8;
}

.help-menu-item.danger {
    color: #ff4757;
}

.help-menu-item.danger:hover {
    background: #fff5f6;
}

/* Custom Modal - Redesigned */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111214;
    margin: 0;
}

.modal-body {
    padding: 24px;
    color: #4A4A4D;
    font-size: 15px;
    line-height: 1.5;
}

.modal-body p {
    margin: 0 0 10px 0;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e5e5e5;
}

.modal-btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    min-width: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-btn-secondary {
    background: white;
    color: #4A4A4D;
    border: 2px solid #E5E5E7;
}

.modal-btn-secondary:hover {
    background: #F7F7F8;
    border-color: #A1A1A6;
}

.modal-btn-primary {
    background: #BF3143;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(191, 49, 67, 0.3);
}

.modal-btn-primary:hover {
    background: #a52938;
    box-shadow: 0 4px 16px rgba(191, 49, 67, 0.4);
    transform: translateY(-1px);
}

.modal-btn-danger {
    background: #BF3143;
    color: white;
}

.modal-btn-danger:hover {
    background: #a02838;
}

/* Modal input */
.modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-top: 12px;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #BF3143;
}

.modal-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.menu-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Responsive */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 300px;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .video-header {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    
    .header-left,
    .header-right {
        font-size: 13px;
        gap: 8px;
    }
    
    .header-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .video-title {
        font-size: 18px;
    }
    
    .video-controls {
        padding: 20px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 24px;
        border-radius: 16px;
    }

    .card-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .beta-badge,
    .live-badge {
        font-size: 14px;
    }

    .language-btn {
        height: 52px;
        font-size: 15px;
    }

    .level-btn {
        height: 58px;
        padding: 0 16px;
    }

    .level-name {
        font-size: 15px;
    }

    .level-duration {
        font-size: 12px;
    }

    .level-badge {
        font-size: 13px;
        padding: 5px 12px;
    }

    .tooltip {
        min-width: 180px;
        max-width: 220px;
        padding: 10px 14px;
    }

    .tooltip-name {
        font-size: 14px;
    }

    .tooltip-languages {
        font-size: 12px;
    }

    .tooltip-interests {
        font-size: 11px;
    }
    
    .match-name {
        font-size: 16px;
    }
    
    .avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }
    
    .local-avatar {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}


/* Session Summary */
.session-summary {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #FFF6F7 0%, #FFFFFF 100%);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.summary-container {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111214;
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #F7F7F8;
    border-radius: 8px;
    border: 1px solid #E5E5E7;
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #A1A1A6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4A4A4D;
}

.summary-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.summary-btn {
    background: #BF3143;
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(191, 49, 67, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-btn:hover {
    background: #a52938;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(191, 49, 67, 0.4);
}

.summary-btn-secondary {
    background: #FFFFFF;
    color: #BF3143;
    border: 2px solid #BF3143;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-btn-secondary:hover {
    background: #FFF6F7;
    color: #a52938;
    border-color: #a52938;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .summary-container {
        padding: 2rem 1.5rem;
    }
    
    .summary-title {
        font-size: 1.5rem;
    }
    
    .summary-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .summary-value {
        font-size: 1rem;
    }
}

.session-id {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    color: #BF3143;
    font-weight: 700;
}

/* Session Summary Phrases */
.summary-phrases {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #F7F7F8;
}

.phrases-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111214;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

.phrases-subtitle {
    font-size: 0.8rem;
    color: #A1A1A6;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.phrases-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

/* Scrollbar styling for phrases list */
.phrases-list::-webkit-scrollbar {
    width: 6px;
}

.phrases-list::-webkit-scrollbar-track {
    background: #F7F7F8;
    border-radius: 3px;
}

.phrases-list::-webkit-scrollbar-thumb {
    background: #BF3143;
    border-radius: 3px;
}

.phrases-list::-webkit-scrollbar-thumb:hover {
    background: #a52938;
}

.phrase-item {
    background: #FFF6F7;
    border-left: 4px solid #BF3143;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.phrase-text {
    font-size: 1rem;
    font-weight: 600;
    color: #4A4A4D;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.phrase-text.incorrect {
    color: #BF3143;
    text-decoration: line-through;
    opacity: 0.7;
}

.phrase-text.correct {
    color: #4A4A4D;
    margin-top: 0.25rem;
}

.phrase-meaning {
    font-size: 0.9rem;
    color: #A1A1A6;
    font-style: italic;
    margin-top: 0.5rem;
}

/* TabbiMate branding */
.tabbi-red {
    color: #BF3143;
}
