/* =============================================================================
   InstaChat - Instagram-style Chat Frontend
   Mobile-first, touch-optimized design
   ============================================================================= */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Mode Color Palette */
    --primary-bg: #000000;
    --secondary-bg: #0a0a0a;
    --surface-bg: #121212;
    --elevated-bg: #1a1a1a;
    --accent-blue: #0095f6;
    --accent-gradient: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
    --border-color: #262626;
    --text-primary: #fafafa;
    --text-secondary: #a8a8a8;
    --text-light: #737373;

    /* Messaging Colors */
    --message-self: #1e3b4f;
    --message-other: #262626;
    --message-text-self: #ffffff;
    --message-text-other: #fafafa;

    /* Status Colors */
    --status-online: #44d362;
    --status-sent: #a8a8a8;
    --status-delivered: #0095f6;
    --status-seen: #0095f6;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Typography - Using distinctive system fonts */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

body {
    font-family: var(--font-primary);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* overflow: hidden;
    height: 100vh; */
    height: 100dvh;
}

.chatOption {
    border-radius: 7px;
    top: 49px;
    position: absolute;
    width: 167px;
    height: 100%;
    min-height: 150px;
    padding: 10px 0px;
    /* background: red; */
    right: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000;
    border: 1px solid #181818;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    flex-direction: column;
    gap: 9px;
}


.chatOption.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.chatOption .chatOption-button {
    width: 95%;
    border: none;
    outline: none;
    border-radius: 5px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    background-color: transparent;
    transition: all .3s ease;
}

.chatOption .chatOption-button:hover {
    background: var(--elevated-bg);
}

.chatOption .chatOption-button.delete:hover {
    background: #231212;
}



/* =============================================================================
   Authentication Screens
   ============================================================================= */

.auth-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.auth-screen.active {
    display: flex;
}

.auth-container {
    width: 100%;
    max-width: 380px;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md), 0 0 40px rgba(245, 133, 41, 0.1);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo svg {
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 4px 12px rgba(56, 151, 240, 0.3));
}

.auth-logo h1 {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 14px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-primary);
    background: var(--primary-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--surface-bg);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.input-group input::placeholder {
    color: var(--text-light);
}

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--transition-normal);
}

.input-group input:focus+.input-focus-border {
    width: 100%;
}

.btn-primary,
.btn-secondary {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    touch-action: manipulation;
    min-height: 44px;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #1aa1f7;
    box-shadow: 0 4px 12px rgba(0, 149, 246, 0.3);
}

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

.btn-secondary {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.btn-secondary:hover {
    background: rgba(0, 149, 246, 0.1);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: var(--spacing-sm) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    padding: 0 var(--spacing-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    background: var(--surface-bg);
}

/* =========================================================
   PURE GOVERNMENT (SSC / NIC) AUTH OVERRIDE
   DO NOT MODIFY HTML OR JS
   ========================================================= */

/* Full page background */
.auth-screen {
    background: #f2f2f2 !important;
}

/* Main box */
.auth-container {
    max-width: 420px !important;
    background: #ffffff !important;
    border: 1px solid #bdbdbd !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 22px !important;
    animation: none !important;
}

/* REMOVE ALL BRANDING GRAPHICS */
.auth-logo svg {
    display: none !important;
}

/* REMOVE "InstaChat" TEXT COMPLETELY */
.auth-logo h1 {
    font-size: 0 !important;
    line-height: 0 !important;
    margin: 0 !important;
}

/* ADD OFFICIAL SSC TITLE USING CSS ONLY */
.auth-logo::before {
    content: "Staff Selection Commission";
    display: block;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #164e87;
    margin-bottom: 4px;
}

.auth-logo::after {
    content: "Government of India";
    display: block;
    text-align: center;
    font-size: 13px;
    color: #555;
    margin-bottom: 16px;
}

/* FORM */
.auth-form {
    gap: 10px !important;
}

/* INPUTS – boring govt style */
.input-group input {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #9e9e9e !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    padding: 9px 8px !important;
    box-shadow: none !important;
}

.input-group input:focus {
    border-color: #164e87 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* REMOVE MODERN EFFECTS */
.input-focus-border {
    display: none !important;
}

/* PRIMARY BUTTON – SSC STYLE */
.btn-primary {
    background: #164e87 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    font-weight: normal !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background: #0d3a5f !important;
}

.btn-primary:active {
    transform: none !important;
}

/* SECONDARY BUTTON */
.btn-secondary {
    background: #ffffff !important;
    color: #164e87 !important;
    border: 1px solid #164e87 !important;
    border-radius: 0 !important;
    font-size: 13px !important;
}

.btn-secondary:hover {
    background: #e8f0fe !important;
}

/* DIVIDER */
.auth-divider span {
    font-size: 12px !important;
    color: #555 !important;
    background: #ffffff !important;
}

.auth-divider::before,
.auth-divider::after {
    background: #bdbdbd !important;
}

/* ADD LEGAL NOTICE (GOVT STYLE) */
.auth-container::after {
    content: "Unauthorized access is prohibited under the Information Technology Act, 2000.";
    display: block;
    margin-top: 15px;
    font-size: 11px;
    color: #666;
    text-align: center;
}

/* MOBILE */
@media (max-width: 480px) {
    .auth-container {
        padding: 18px !important;
    }

    .auth-logo::before {
        font-size: 18px;
    }
}


/* =============================================================================
   Chat Screen Layout
   ============================================================================= */

.chat-screen {
    display: none;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.chat-screen.active {
    display: block;
}

.chat-layout {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
}

/* =============================================================================
   Chat List Sidebar
   ============================================================================= */

.chat-list-sidebar {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
    border-right: 1px solid var(--border-color);
    transition: transform var(--transition-normal);
}

.chat-list-sidebar.hidden {
    transform: translateX(-100%);
}

.chat-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-profile span {
    font-weight: var(--font-weight-medium);
    font-size: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: 16px;
    flex-shrink: 0;
}

.icon-btn {
    width: 31px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--elevated-bg);
}

.icon-btn:active {
    transform: scale(0.95);
}

.chat-list-search {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.chat-list-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--surface-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
}

.chat-list-search input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--elevated-bg);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.chat-item:hover {
    background: var(--elevated-bg);
}

.chat-item.active {
    background: var(--elevated-bg);
}

.chat-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-blue);
}

.chat-item .avatar {
    position: relative;
}

.chat-item .avatar.online::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--status-online);
    border: 2px solid var(--primary-bg);
    border-radius: var(--radius-full);
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.chat-item-username {
    font-weight: var(--font-weight-medium);
    font-size: 14px;
    color: var(--text-primary);
}

.chat-item-time {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chat-item-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-preview.unread {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
}

.unread-badge {
    min-width: 20px;
    height: 20px;
    position: absolute;
    padding: 0 6px;
    background: var(--accent-blue);
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    right: 14px;
    bottom: 13px;
}

/* =============================================================================
   Chat Window
   ============================================================================= */

.chat-window {
    flex: 1;
    display: none;
    flex-direction: column;
    height: 100%;
    background: var(--primary-bg);
}

.chat-window.active {
    display: flex;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.empty-icon {
    margin-bottom: var(--spacing-lg);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.chat-empty-state h2 {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
}

.chat-empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-bg);
    z-index: 10;
    position: relative;
}

.back-btn {
    display: none;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    min-width: 0;
}

.chat-header-text {
    flex: 1;
    min-width: 0;
}

.chat-header-text h3 {
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.online-status.online {
    color: var(--status-online);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--primary-bg);
    padding: var(--spacing-md);
}

.messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Message Bubbles */
.message {
    display: flex;
    /* gap: var(--spacing-sm); */
    max-width: 80%;
    animation: messageSlide 0.3s ease;
    position: relative;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.self {
    align-self: flex-end;
    /* flex-direction: row-reverse; */
    flex-direction: column;
}

.message.other {
    align-self: flex-start;
    flex-direction: column;

}

.message-bubble {
    position: relative;
    /* padding: 10px 0px 15px 14px; */
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message.self .message-bubble {
    background: var(--message-self);
    color: var(--message-text-self);
    border-bottom-right-radius: var(--radius-sm);
    flex-direction: column;
}

.message.self .message-bubble div {
    padding-right: 10px;
}

.message.other .message-bubble {
    background: var(--message-other);
    color: var(--message-text-other);
    border-bottom-left-radius: var(--radius-sm);
}

/* Reply Preview in Message */
.message-reply-preview {
    padding: 4px !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
    border-left: 3px solid currentColor;
}

.message.self .message-reply-preview {
    background: rgba(255, 255, 255, 0.15);
    margin-right: 10px;
}

.message-reply-preview .reply-username {
    font-weight: var(--font-weight-bold);
    margin-bottom: 2px;
}

.message-reply-preview .reply-text,
.message-reply-preview .reply-image {
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-reply-preview .reply-image {
    width: 50px;
    height: 40px;
}

.message-reply-preview .reply-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Media Messages */
.message-media {
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 350px;
    padding: 10px !important;
}

.message-media img,
.message-media video {
    width: 100%;
    max-width: 270px;
    display: block;
    border-radius: var(--radius-md);
    object-fit: cover;
    height: 100%;
}

.message.other .message-bubble .message-media img,
.message.other .message-bubble .message-media video {

    border-bottom-left-radius: var(--radius-sm);
}

.message.self .message-bubble .message-media img,
.message.self .message-bubble .message-media video {

    border-bottom-right-radius: var(--radius-sm);
}

.message.other .message-bubble .message-media,
.message.other .message-bubble .message-media {

    border-bottom-left-radius: var(--radius-sm);
}

.message.self .message-bubble .message-media,
.message.self .message-bubble .message-media {

    border-bottom-right-radius: var(--radius-sm);
}

/* Reactions */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reaction:hover {
    background: var(--elevated-bg);
    border-color: var(--text-light);
}

.reaction.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Message Status */
.message-status {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: #070707;
}

.message.self .message-status {
    justify-content: flex-end;
    position: absolute;
    bottom: 1px;
    right: 1px;
    /* background: rgba(0, 0, 0, 0.55); */
    border-radius: 10px;
    padding: 5px 5px;
    backdrop-filter: blur(4px);
    padding: 0px 4px 0px 4px !important;
}

.status-icon {
    width: 14px;
    height: 14px;
}

.status-icon.seen {
    color: var(--status-seen);
}

/* Timestamp */
.message-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: right;
}

.message.other .message-time {
    text-align: left;

}

/* =============================================================================
   Chat Input
   ============================================================================= */

.chat-input-container {
    border-top: 1px solid var(--border-color);
    background: var(--primary-bg);
    padding: var(--spacing-md);
}

.reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--elevated-bg);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

.reply-content {
    flex: 1;
    min-width: 0;
}

.reply-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.reply-preview p {
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview p .reply-image {
    width: 50px;
    height: 40px;
}

.reply-preview p .reply-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-input {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-sm);
    transition: border-color var(--transition-fast);
}

.chat-input:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.chat-input input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--text-primary);
    outline: none;
    width: 121px;
}

.chat-input input::placeholder {
    color: var(--text-light);
}

.send-btn {
    color: var(--accent-blue);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
    background: rgba(0, 149, 246, 0.15);
}

/* =============================================================================
   Emoji Picker Modal
   ============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.emoji-picker {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 149, 246, 0.1);
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.emoji-header h3 {
    font-size: 16px;
    font-weight: var(--font-weight-medium);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: var(--spacing-xs);
    max-height: 300px;
    overflow-y: auto;
}

.emoji-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: var(--elevated-bg);
    transform: scale(1.1);
}

.emoji-btn:active {
    transform: scale(0.95);
}

/* =============================================================================
   Toast Notifications
   ============================================================================= */

.toast-container {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--elevated-bg);
    color: var(--text-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.3s ease;
    min-width: 200px;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    background: var(--status-online);
}

.toast.error {
    background: #ed4956;
}

/* =============================================================================
   Mobile Responsive Styles
   ============================================================================= */

@media (min-width: 768px) {

    /* Desktop: Show both sidebar and window */
    .chat-list-sidebar {
        width: 380px;
        flex-shrink: 0;
    }

    .chat-window {
        display: flex;
    }

    .back-btn {
        display: none !important;
    }
}

@media (max-width: 767px) {

    /* Mobile: Stack layout */
    .chat-layout {
        position: relative;
    }

    .chat-list-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10;
    }

    .chat-list-sidebar.hidden {
        transform: translateX(-100%);
    }

    .chat-window {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        transform: translateX(100%);
        transition: transform var(--transition-normal);
    }

    .chat-window.active {
        transform: translateX(0);
    }

    .back-btn {
        display: flex !important;
    }

    .message {
        max-width: 85%;
    }

    .auth-container {
        padding: var(--spacing-lg);
    }

    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .toast {
        width: 100%;
    }
}

/* =============================================================================
   Touch & Gesture Enhancements
   ============================================================================= */

@media (hover: none) and (pointer: coarse) {

    /* Enhance touch targets for mobile */
    .icon-btn,
    .avatar,
    .reaction,
    .emoji-btn {
        min-width: 31px;
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .chat-item:hover,
    .icon-btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        background: inherit;
    }

    /* Active states for touch feedback */
    .chat-item:active {
        background: var(--elevated-bg);
    }
}

/* Long Press Animation */
.message-bubble.long-press {
    animation: longPressScale 0.3s ease;
}

@keyframes longPressScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Swipe Indicator */
.message.swiping {
    transform: translateX(var(--swipe-x, 0));
    transition: transform 0.1s linear;
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

.chat-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar,
.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track,
.emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb,
.emoji-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover,
.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* =============================================================================
   Utility Classes
   ============================================================================= */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =============================================================================
   Loader
   ============================================================================= */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.loader-spinner {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    border: 3px solid transparent;
    border-top-color: #f58529;
    animation: spinRing 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(1) {
    width: 100%;
    height: 100%;
    border-top-color: #f58529;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    border-top-color: #dd2a7b;
    animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    border-top-color: #8134af;
    animation-delay: -1s;
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-logo {
    position: absolute;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(56, 151, 240, 0.3));
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.loader-text {
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    animation: fadeInOut 2s ease-in-out infinite;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.status-icon {
    width: 20px;
    height: 14px;
    fill: none;
    stroke-width: 2;
}

/* single tick (sent) */
.status-icon.sent {
    stroke: white;
    /* gray */
}

/* double tick delivered */
.status-icon.delivered {
    stroke: white;
    /* gray */
}

/* double tick seen */
.status-icon.seen {
    stroke: #1da1f2;
    /* WhatsApp blue */
}


@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}



.message-media {
    position: relative;
}

.media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.media-cancel,
.media-retry {
    background: transparent;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 50%;
    cursor: pointer;
    position: absolute;
    font-size: 34px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.messag-text {
    padding: 10px 10px 15px 10px;
}

.messag-text a,
.messag-text a:visited {
    color: greenyellow;
}

.status-icon.clock {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.8;
}

.message-media {
    position: relative;
}

.video-thumb {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 42px;
    color: white;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;

    pointer-events: none;
}




.media-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-thumbnail:hover {
    transform: scale(1.05);
}

.video-thumbnail {
    position: relative;
}

.video-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
}

/* Media Viewer Overlay */
.media-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-viewer-overlay.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* Header */
.viewer-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sender-name {
    font-weight: 600;
}

.media-counter {
    color: #aaa;
    font-size: 14px;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
}

/* Main Viewer Area */
.viewer-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.media-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.media-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.media-slide img,
.media-slide video {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-arrow.left {
    left: 20px;
}

.nav-arrow.right {
    right: 20px;
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Thumbnail Strip */
.thumbnail-strip {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    overflow-x: auto;
    overflow-y: hidden;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    min-width: min-content;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    position: relative;
}

.thumbnail-item.active {
    border-color: #25d366;
}

.thumbnail-item img,
.thumbnail-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item.video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    pointer-events: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 24px;
        display: none;
        /* Hide on mobile, use swipe instead */
    }

    .viewer-header {
        padding: 10px 15px;
    }

    .thumbnail-strip {
        padding: 10px 15px;
    }

    .thumbnail-item {
        width: 50px;
        height: 50px;
    }
}

/* Scrollbar styling */
.thumbnail-strip::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.thumbnail-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}


/* Chat Container */
#chat-container {
    display: none;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

#chat-container.active {
    display: block;
}

/* Dashboard Container */
#ssc-dashboard {
    display: block;
    transition: opacity 0.3s ease;
}

#ssc-dashboard.hidden {
    display: none;
}


#chat-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Top Bar */
.top-bar {
    background: #164e87;
    color: white;
    padding: 5px 0;
    font-size: 12px;
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    transition: color 0.2s;
}

.top-links a:hover {
    color: #ffd700;
}

/* Header */
.header {
    background: white;
    padding: 15px 0;
    border-bottom: 3px solid #e74c3c;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Secret Button - Triple Click on Emblem */
.emblem {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 28px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.emblem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emblem:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.emblem:active {
    transform: scale(0.95);
}

/* Click indicator */
.emblem::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color 0.3s;
}

.emblem.clicked::after {
    border-color: #ffd700;
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.title-section h1 {
    color: #164e87;
    font-size: 26px;
    margin-bottom: 5px;
    font-weight: 700;
}

.title-section p {
    color: #666;
    font-size: 14px;
}

.hindi-text {
    color: #e74c3c;
    font-size: 16px;
    margin-bottom: 3px;
}

.right-section {
    text-align: right;
}

.accessibility-links {
    font-size: 12px;
    margin-bottom: 8px;
}

.accessibility-links a {
    color: #164e87;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
}

.accessibility-links a:hover {
    text-decoration: underline;
}

.font-controls {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
    margin-top: 5px;
}

.font-btn {
    background: #164e87;
    color: white;
    border: none;
    padding: 3px 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 11px;
}

/* Navigation */
.nav-bar {
    background: #2c5f96;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
}

.nav-content a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    display: block;
    transition: background 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.nav-content a:hover {
    background: #164e87;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Carousel */
.carousel {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.carousel-inner {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: white;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-arrow.prev {
    left: 10px;
}

.carousel-arrow.next {
    right: 10px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: #164e87;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.card ul {
    list-style: none;
}

.card li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.card li:last-child {
    border-bottom: none;
}

.card a {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.card a:hover {
    color: #e74c3c;
}

.card a::before {
    content: '▸';
    color: #e74c3c;
}

.new-badge {
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}

/* What's New Section */
.whats-new {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.whats-new h3 {
    color: #164e87;
    margin-bottom: 15px;
    font-size: 18px;
}

.news-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
}

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

.news-date {
    background: #164e87;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 80px;
    text-align: center;
}

.news-content {
    flex: 1;
}

.news-content a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.news-content a:hover {
    color: #e74c3c;
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #164e87;
    color: white;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.footer h4 {
    margin-bottom: 15px;
    font-size: 16px;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 8px;
}

.footer a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: white;
}

.copyright {
    background: #0d3a5f;
    color: #ccc;
    text-align: center;
    padding: 15px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-content {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .carousel-inner {
        height: 250px;
    }
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {

    /* Dashboard wrapper */
    #ssc-dashboard {
        width: 100%;
        overflow-x: hidden;
    }

    /* Top bar */
    .top-bar-content {
        flex-direction: column;
        gap: 5px;
        text-align: center;
        font-size: 11px;
    }

    /* Header */
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
        gap: 8px;
    }

    .emblem {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .title-section h1 {
        font-size: 20px;
    }

    .hindi-text {
        font-size: 14px;
    }

    .title-section p {
        font-size: 12px;
    }

    .right-section {
        text-align: center;
    }

    .accessibility-links {
        margin-bottom: 4px;
    }

    .font-controls {
        justify-content: center;
    }

    /* Navigation */
    .nav-content {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }

    .nav-content a {
        padding: 10px 14px;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Main layout */
    .container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 12px auto;
        padding: 0 12px;
    }

    /* Carousel */
    .carousel-inner {
        height: 220px;
    }

    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .carousel-controls {
        bottom: 10px;
    }

    /* Cards */
    .card {
        padding: 15px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card li {
        font-size: 13px;
    }

    /* What's New */
    .news-item {
        flex-direction: column;
        gap: 6px;
    }

    .news-date {
        font-size: 11px;
        width: fit-content;
    }

    .news-content a {
        font-size: 13px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .footer ul {
        padding: 0;
    }

    .footer li {
        margin-bottom: 6px;
    }

    .copyright {
        font-size: 12px;
        padding: 10px;
    }
}



/* Fullscreen lock */
#passwordOverlay {
    position: fixed;
    inset: 0;
    background: #f4f6f8;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
}

.passwordOverlay {
    display: none;
}

.passwordOverlay.active {
    display: flex;
}

/* Box */
.gov-password-box {
    width: 92%;
    max-width: 420px;
    background: white;
    border: 1px solid #cfd8dc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Header */
.gov-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #164e87;
    color: white;
}

.gov-emblem {
    font-size: 28px;
}

.gov-hindi {
    font-size: 14px;
    font-weight: bold;
}

.gov-eng {
    font-size: 13px;
}

/* Content */
.gov-content {
    padding: 20px;
}

.gov-note {
    font-size: 13px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.5;
}

.gov-label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
    color: #164e87;
}

.gov-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #b0bec5;
    margin-bottom: 15px;
}

.gov-input:focus {
    outline: none;
    border-color: #164e87;
}

/* Button */
.gov-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    background: #164e87;
    color: white;
    border: none;
    cursor: pointer;
}

.gov-btn:hover {
    background: #0d3a5f;
}

/* Error */
.gov-error {
    margin-top: 10px;
    font-size: 12px;
    color: #c62828;
}

/* Footer */
.gov-footer {
    padding: 10px;
    font-size: 11px;
    text-align: center;
    background: #f1f1f1;
    color: #555;
}

.gov-btn.loading {
    background: #90a4ae;
    cursor: not-allowed;
}

.gov-btn.loading::after {
    content: " Please wait…";
    font-weight: normal;
}

/* ============================================
   VOICE RECORDING IN INPUT
============================================ */

.voice-recording-ui {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    /* background: #f0f0f0; */
    border-radius: 24px;
    /* padding: 0.5rem 1rem; */
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.voice-cancel-btn,
.voice-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}

.voice-cancel-btn {
    background: #ff3b30;
}

.voice-cancel-btn svg {
    stroke: #fff;
}

.voice-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.voice-send-btn svg {
    stroke: #fff;
}

.voice-cancel-btn:active,
.voice-send-btn:active {
    transform: scale(0.9);
}

.voice-waveform-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

#voiceWaveformCanvas {
    flex: 1;
    height: 40px;
    min-width: 100px;
}

.voice-timer {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Recording pulse animation */
@keyframes recordPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.voice-waveform-container.recording {
    animation: recordPulse 1.5s ease-in-out infinite;
}

/* ============================================
   AUDIO MESSAGE PLAYER
============================================ */

.message-audio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    min-width: 200px;
    max-width: 200px;
    width: 100%;
}

.self .message-audio {
    background: rgba(255, 255, 255, 0.2);
    border-bottom-right-radius: var(--radius-sm);
}

.audio-play-btn {
    width: 42px;
    height: 41px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.audio-play-btn:active {
    transform: scale(0.9);
}

.audio-play-btn svg {
    fill: #fff;
    width: 16px;
    height: 16px;
}

.audio-waveform {
    flex: 1;
    height: 30px;
    position: relative;
    cursor: pointer;
    min-width: 80px;
}

.audio-waveform canvas {
    width: 100%;
    height: 100%;
}

.audio-time {
    font-size: 0.75rem;
    color: #8e8e8e;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.self .audio-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Audio loading state */
.message-audio.loading .audio-play-btn {
    pointer-events: none;
    opacity: 0.6;
}

.message-audio.loading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}