html,
body {
 font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0d6efd;
}

a:hover {
    color: #0a58ca;
}

/* ========== HEADER LAYOUT ========== */

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-header .brand {
    color: white;
    text-decoration: none;
 font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-header .brand:hover {
    color: rgba(255, 255, 255, 0.9);
}

.top-header .brand-icon-img {
    width: 36px;
    height: 36px;
    filter: brightness(0) invert(1);
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.header-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
  padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.header-nav .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.header-nav .nav-icon {
    width: 18px;
  height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.header-nav .nav-icon-emoji {
    font-size: 1.1rem;
    line-height: 1;
}

.main-content {
    flex: 1;
    background: #f5f7fa;
}

.main-content .content {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== FOOTER ========== */

.app-footer {
    background: #212529;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem;
  font-size: 0.875rem;
}

.app-footer a {
color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.app-footer a:hover {
    color: white;
    text-decoration: underline;
}

/* ========== STATIC PAGES ========== */

.static-page {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 0 auto;
}

.static-page h1 {
    color: #212529;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.static-page h2 {
    color: #495057;
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.static-page h3 {
    color: #6c757d;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.static-page p {
    color: #495057;
    line-height: 1.7;
}

.static-page ul {
    color: #495057;
    line-height: 1.8;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.feature-icon-img {
    width: 64px;
 height: 64px;
    margin-bottom: 1rem;
}

.feature-card h3 {
 border: none;
 margin-top: 0;
    color: #212529;
  font-size: 1.2rem;
}

/* ========== OAUTH BRANDED BUTTONS ========== */

.btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    font-family: "Google Sans", "Segoe UI", sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-google:hover:not(:disabled) {
    background: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    color: #3c4043;
}

.btn-google:focus-visible {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-microsoft {
    background: #ffffff;
    color: #5e5e5e;
    border: 1px solid #8c8c8c;
    font-family: "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0;
    transition: background 0.2s;
    cursor: pointer;
}

.btn-microsoft:hover:not(:disabled) {
    background: #f3f3f3;
    color: #5e5e5e;
}

.btn-microsoft:focus-visible {
    outline: 3px solid #00a4ef;
    outline-offset: 2px;
}

.btn-microsoft:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== CARD SHELL ========== */

.card-shell {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-shell h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

/* ========== CHAT STYLES ========== */

.chat-container {
    height: calc(100vh - 8rem);
    min-height: 500px;
}

/* Thread List */
.thread-list {
    max-height: 400px;
}

.thread-item {
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.thread-item:hover {
    background-color: #f8f9fa;
}

.thread-item.active {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

.thread-topic {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Messages */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 300px;
    max-height: calc(100vh - 24rem);
}

.message-wrapper {
    display: flex;
    max-width: 80%;
}

.message-wrapper.sent {
    align-self: flex-end;
}

.message-wrapper.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 100%;
    word-wrap: break-word;
}

.message-wrapper.sent .message-bubble {
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-wrapper.received .message-bubble {
    background-color: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.message-content {
  line-height: 1.4;
}

.message-time {
    font-size: 0.7rem;
  opacity: 0.7;
    margin-top: 0.25rem;
    text-align: right;
}

.typing-indicator {
    padding: 0.5rem 0;
    font-style: italic;
}

/* Message Input */
.message-input-area .form-control {
    border-radius: 1.5rem 0 0 1.5rem;
padding-left: 1rem;
}

.message-input-area .btn {
    border-radius: 0 1.5rem 1.5rem 0;
}

/* Video Call Overlay */
.video-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
 bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1050;
    display: flex;
    align-items: center;
  justify-content: center;
}

.video-call-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.video-call-container.voice-only {
 max-width: 500px;
}

.video-call-header {
    display: flex;
    justify-content: space-between;
  align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    margin-bottom: 1rem;
}

.video-call-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
}

.video-call-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
animation: pulse 2s infinite;
}

@keyframes pulse {
 0%, 100% {
 transform: scale(1);
     opacity: 1;
  }
    50% {
        transform: scale(1.1);
  opacity: 0.8;
    }
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    overflow: auto;
}

.video-tile {
    background: #1a1a1a;
    border-radius: 12px;
    min-height: 200px;
 position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-tile video {
    width: 100%;
    height: 100%;
  object-fit: cover;
}

.video-label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.local-video {
    border: 2px solid #0d6efd;
}

.video-call-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
}

.video-call-controls .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
}

/* Modal Styles */
.modal-backdrop.show {
    position: fixed;
    top: 0;
    left: 0;
right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.modal.show {
    z-index: 1050;
}

/* ========== ERROR UI ========== */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .top-header {
  padding: 0.5rem 1rem;
    }

    .top-header .container-fluid {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-nav .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }

    .chat-container {
        height: auto;
        min-height: calc(100vh - 12rem);
    }

    .messages-container {
        max-height: 50vh;
    }

    .message-wrapper {
      max-width: 90%;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .static-page {
  padding: 1.25rem;
        margin: 0 0.5rem;
    }
}

/* ========== PROFILE PAGE ========== */

.profile-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
padding: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.linked-accounts {
    display: flex;
    flex-direction: column;
gap: 0.75rem;
}

.linked-account {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.provider-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.provider-icon.google {
    background: #ea4335;
}

.provider-icon.microsoft {
    background: #00a4ef;
}

.provider-icon.facebook {
    background: #1877f2;
}

/* ========== AI CHAT PAGE ========== */

.ai-chat-page {
    max-width: 900px;
    margin: 0 auto;
    height: calc(100vh - 10rem);
 min-height: 500px;
}

.ai-chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
  display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.ai-avatar img {
    width: 100%;
    height: 100%;
    filter: brightness(0) invert(1);
}

.ai-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Welcome Screen */
.ai-welcome {
    text-align: center;
    padding: 2rem;
    margin: auto;
}

.ai-welcome-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.ai-welcome h3 {
    color: #212529;
    margin-bottom: 0.5rem;
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.ai-suggestions .btn {
    font-size: 0.85rem;
}

/* Messages */
.ai-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-message-avatar {
    width: 36px;
  height: 36px;
    border-radius: 50%;
 flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    padding: 6px;
}

.ai-message.assistant .ai-message-avatar img {
    width: 100%;
    height: 100%;
    filter: brightness(0) invert(1);
}

.ai-message.user .ai-message-avatar {
    background: #e9ecef;
    font-size: 1.2rem;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-message-content {
    display: flex;
    flex-direction: column;
  gap: 0.25rem;
}

.ai-message-text {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
  line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-message.user .ai-message-text {
    background: #0d6efd;
    color: white;
  border-bottom-right-radius: 4px;
}

.ai-message.assistant .ai-message-text {
    background: #f8f9fa;
 color: #212529;
    border-bottom-left-radius: 4px;
}

.ai-message-meta {
    padding: 0 0.5rem;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
 background: #f8f9fa;
    border-radius: 1rem;
    border-bottom-left-radius: 4px;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(1) {
    animation-delay: 0s;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Input Area */
.ai-input-area {
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.ai-input-area .form-control {
    border-radius: 1.5rem 0 0 1.5rem;
    padding-left: 1.25rem;
}

.ai-input-area .btn {
    border-radius: 0 1.5rem 1.5rem 0;
    padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.ai-input-hint {
    text-align: center;
    font-size: 0.75rem;
}

/* ========== VIDEO TEST PAGE ========== */

.video-preview-wrapper {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
 min-height: 400px;
    overflow: hidden;
}

.video-preview-container {
    width: 100%;
    min-height: 400px;
    display: flex;
align-items: center;
  justify-content: center;
}

.video-preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6c757d;
    background: #1a1a1a;
}

.video-preview-placeholder .preview-icon {
    width: 80px;
    height: 80px;
    opacity: 0.5;
 margin-bottom: 1rem;
}

.video-preview-placeholder p {
 margin: 0;
}

@media (max-width: 768px) {
    .video-preview-wrapper,
    .video-preview-container {
        min-height: 250px;
    }
}

/* ========== CALL WAITING & RINGING ========== */

.waiting-overlay {
    position: absolute;
    bottom: 0;
left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
 padding: 1rem;
    text-align: center;
}

.waiting-text {
 color: white;
    font-size: 0.9rem;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.6; }
 50% { opacity: 1; }
}

.voice-call-icon.ringing {
    animation: ringing 0.5s infinite alternate;
}

@keyframes ringing {
    0% { transform: rotate(-10deg) scale(1); }
    100% { transform: rotate(10deg) scale(1.1); }
}

.voice-waiting {
  text-align: center;
}

.call-duration {
 text-align: center;
}

.video-tile {
 position: relative;
}

/* ========== CALL UI IMPROVEMENTS ========== */

.call-status-badges {
    display: flex;
 gap: 0.5rem;
    align-items: center;
}

.waiting-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.waiting-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.waiting-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.voice-self {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
color: white;
}

.voice-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.video-call-controls .btn {
    min-width: 100px;
}

@media (max-width: 768px) {
    .video-call-controls .btn {
        min-width: auto;
    padding: 0.5rem;
    }
    
.call-status-badges {
 flex-wrap: wrap;
     font-size: 0.75rem;
    }
}

