@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-blue: #007bff;
    --light-blue: #e7f3ff;
    --dark-grey: #4e4e4e;
    --medium-grey: #8a8a8a;
    --light-grey: #e6ede6;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --active-chat-bg: #e7f3ff;
    --sent-message-bg: #007bff;
    --sending-message-bg: #68686a;
    --sent-message-color: #ffffff;
    --received-message-bg: #f0f2f5;
    --received-message-color: #333333;
    --online-green: #2bb305;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-grey);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    display: flex;
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 95%;
    max-width: 1400px;
    height: calc(100vh - 40px);
}

.left-sidebar {
    width: 70px;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    justify-content: space-between;
    position: relative;
    min-width: 70px;
}

.app-logo {
    font-size: 30px;
    color: var(--primary-blue);
    margin-bottom: 30px;
}

.nav-icons {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.nav-icons li {
    font-size: 22px;
    color: var(--medium-grey);
    cursor: pointer;
    position: relative;
    padding: 5px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-icons li:hover {
    background-color: var(--light-blue);
    color: var(--primary-blue);
}

.nav-icons li.active {
    color: var(--primary-blue);
    background-color: var(--light-blue);
}

.nav-icons li .tooltip {
    visibility: hidden;
    width: 80px;
    background-color: var(--dark-grey);
    color: var(--white);
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    left: 80px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.nav-icons li:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 2px;
    box-sizing: border-box;
}

.badge.badge-dot {
    width: 10px;
    height: 10px;
    top: 0px;
    right: 0px;
    padding: 0;
    background-color: var(--primary-blue);
    border: 1px solid var(--white);
}

.nav-icons li .tooltip {
    left: 80px;
}

.user-profile-bottom{
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
}

.user-profile-bottom .profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.user-profile-bottom .profile-pic:hover {
    border-color: var(--primary-blue);
}

.bottom-action-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 7px;
    font-size: 22px;
    color: var(--medium-grey);
    cursor: pointer;
    position: relative;
    padding: 5px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.bottom-action-icon:hover {
    background-color: var(--light-blue);
    color: var(--primary-blue);
}

.middle-panel {
    width: 400px;
    min-width: 400px;
    border-right: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    background-color: var(--white);
}

.middle-panel.active-panel {
    display: flex;
}

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

.panel-header h2 {
    font-size: 22px;
    color: var(--dark-grey);
}

.header-icons i {
    font-size: 18px;
    color: var(--medium-grey);
    margin-left: 15px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.header-icons i:hover {
    color: var(--primary-blue);
}

.search-bar {
    position: relative;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: none;
    border-radius: 20px;
    background-color: var(--light-grey);
    font-size: 14px;
    color: var(--dark-grey);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--medium-grey);
}

.search-bar i {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium-grey);
    font-size: 16px;
}

.chat-items-container, .people-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 10px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.chat-item:hover {
    background-color: var(--light-grey);
}

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

.chat-item .profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    flex-shrink: 0;
}

.chat-item .profile-pic.online::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 12px;
    height: 12px;
    background-color: var(--online-green);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.chat-item .chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.chat-item .chat-meta .accept-btn {
    background-color: var(--primary-blue);
    color: var(--white);
    border: 1px solid var(--primary-blue);
    padding: 2px;
    margin: 1px;
    cursor: pointer;
}

.chat-item .chat-meta .accept-btn:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chat-item .chat-meta .decline-btn {
    background-color: var(--white);
    color: var(--dark-grey);
    border: 1px solid var(--border-color);
    padding: 2px;
    margin: 1px;
    cursor: pointer;
}

.chat-item .chat-meta .decline-btn:hover {
    background-color: var(--light-grey);
    border-color: var(--medium-grey);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chat-item .chat-meta {
    gap: 8px;
}

/* Show button-options when chat-item is hovered */
.chat-item:hover .button-options, .person-item:hover .button-options {
    display: flex; /* Or 'block', 'inline-block', depending on your desired layout */
    opacity: 1;
}

.button-options{
    border-radius: 3em;
    /*background-color: #f60;
    display: flex;*/
    display: none;
    position: relative;
    min-width: 1.5em;
    min-height: 2.5em;
    justify-content: center;
    align-items: center;
    /* Optional: Add a transition for a smoother effect */
    transition: background-color 0.3s ease;
}

.button-options:hover {
    background-color: #c9c9ca;
}

.button-options.active-menu{
    display: flex;
    background-color: #c9c9ca;
}

.text-and-buttons-wrapper .chat-meta{
    margin: 2px;
}

.chat-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-name {
    font-weight: 600;
    color: var(--dark-grey);
    font-size: 16px;
}

.last-message {
    font-size: 14px;
    color: var(--medium-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.install-app-btn {
    width: calc(100% - 40px);
    margin: 20px auto;
    padding: 12px 20px;
    background-color: var(--light-grey);
    color: var(--primary-blue);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.install-app-btn:hover {
    background-color: var(--border-color);
}

.person-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 15px;
}
.person-item:hover {
    background-color: var(--light-grey);
}
.person-item .profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.person-info {
    display: flex;
    flex-direction: column;
}
.person-name {
    font-weight: 600;
    color: var(--dark-grey);
    font-size: 16px;
    text-align: left;
}
.person-status {
    font-size: 14px;
    color: var(--medium-grey);
    text-align: left;
}
.person-status.online {
    color: var(--online-green);
}

.main-chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--white);
    z-index: 10;
}

.mobile-back-button, .mobile-info-button, .mobile-close-button {
    display: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--medium-grey);
    margin-right: 15px;
}
.mobile-info-button {
    margin-left: 15px;
}

.chat-partner-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.chat-partner-info .profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.name-status {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-right: 15px;
}

.chat-partner-info h3 {
    font-size: 18px;
    color: var(--dark-grey);
    margin: 0;
}

.online-dot-indicator {
    font-size: 14px;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 5px;
}
.online-dot-indicator.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--online-green);
    border-radius: 50%;
    display: inline-block;
}
.online-dot-indicator:not(.online) {
    color: var(--medium-grey);
}


.chat-header-actions i {
    font-size: 20px;
    color: var(--medium-grey);
    margin-left: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chat-header-actions i:hover {
    color: var(--primary-blue);
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-divider {
    text-align: center;
    font-size: 12px;
    color: var(--medium-grey);
    margin: 20px 0;
    position: relative;
    text-transform: uppercase;
}

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

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

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


.message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.message img {
    width: 40px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-text {
    padding: 5px 10px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.message-time {
    font-size: 11px;
    color: var(--medium-grey);
    margin-top: 1px;
}

.message.received {
    justify-content: flex-start;
}

.message.received .message-text {
    background-color: var(--received-message-bg);
    color: var(--received-message-color);
    border-bottom-left-radius: 5px;
}
.message.received .message-time {
    color: var(--received-message-color);
    border-bottom-left-radius: 5px;
    align-items: flex-start;
}

.message.sent {
    justify-content: flex-end;
}

.message.sent .message-text {
    background-color: var(--sent-message-bg);
    color: var(--sent-message-color);
    border-bottom-right-radius: 5px;
    align-items: flex-end;
    transition: background-color 0.5s ease;
}

.message-sending {
    background-color: var(--sending-message-bg) !important;
}

.message.sent .message-time {
    align-self: flex-end;
    margin-right: 5px;
}

.audio-spectrum {
    display: flex;
    align-items: center;
    gap: 1px;
    height: 25px;
    padding: 0 5px;
    width: 100px;
    overflow: hidden;
}

.audio-spectrum span {
    width: 3px;
    background-color: currentColor;
    border-radius: 1px;
    display: inline-block;
    height: var(--bar-height, 50%);
    transition: height 0.1s ease-out;
}

.message-image {
    max-width: 250px;
    min-width: 100px;
    max-height: 250px;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    margin-bottom: 5px;
    display: block;
    width: auto;
    height: auto;
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--white);
    gap: 10px;
}

.input-icons {
    display: flex;
    align-items: center;
    padding-bottom: 8px;
}

.input-icons i {
    font-size: 20px;
    color: var(--medium-grey);
    cursor: pointer;
    margin-right: 10px;
    transition: color 0.2s ease;
}

.input-icons i:hover {
    color: var(--primary-blue);
}

.message-input {
    flex-grow: 1;
    padding: 7px 10px;
    border: none;
    border-radius: 20px;
    background-color: var(--light-grey);
    font-size: 15px;
    color: var(--dark-grey);
    outline: none;
    resize: none;
    height: 40px;
    min-height: 40px;
    max-height: 140px;
    line-height: 20px;
    overflow-y: auto;
}

.message-input::placeholder {
    color: var(--medium-grey);
}

.chat-input-button{
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-bottom: 3px;
}

.chat-input-button:hover {
    background-color: #0056b3;
}


.right-details-panel {
    width: 300px;
    background-color: var(--white);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex-grow: 0;
    /*transition: width 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;*/
}

.right-details-panel .panel-header {
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    position: relative;
}

.right-details-panel .mobile-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    display: none;
}

.right-details-panel.hide{
    /*width: 0;
    opacity: 0;*/
    display: none;
    /*transition: width 0.3s ease-out 0.0s, opacity 0.3s ease-out 0.3s;*/
}

.right-details-panel .section-button{
    font-size: 0.8em;
    color: #3a3a3a;
    border-radius: 1em;
    padding: 0.5em 0.8em 0.5em 0.8em;
    margin: 0 0.2em 0 0.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: #cecece;
}
.right-details-panel .section-button:hover{
    color: #1d4ed8;
    background-color: #e6e6e6;
}

.right-details-panel .section-button.active{
    color: #1d4ed8;
    background-color: #e6e6e6;
    border: 1px solid #1d4ed8;
}

.profile-summary .profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.profile-summary h3 {
    font-size: 20px;
    color: var(--dark-grey);
    margin-bottom: 5px;
}

.profile-summary span {
    font-size: 14px;
    color: var(--primary-blue);
}

.actions {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 20px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--medium-grey);
    cursor: pointer;
    transition: color 0.2s ease;
}

.action-item i {
    font-size: 20px;
    background-color: var(--light-grey);
    padding: 10px;
    border-radius: 50%;
}

.action-item:hover {
    color: var(--primary-blue);
}

.action-item:hover i {
    background-color: var(--light-blue);
    color: var(--primary-blue);
}

.panel-sections {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0px;
}

.section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.section:last-of-type {
    border-bottom: none;
}

.section:hover {
    background-color: var(--light-grey);
}

.section h4 {
    font-size: 16px;
    color: var(--dark-grey);
    font-weight: 500;
}

.section i {
    font-size: 14px;
    color: var(--medium-grey);
}

.media-grid-container {
    overflow-y: auto;
    max-height: 200px;
    padding: 10px 10px;
    border-bottom: 1px solid var(--border-color);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.media-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.media-grid img:hover {
    transform: scale(1.03);
}


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h2 {
    color: var(--dark-grey);
    margin-bottom: 15px;
}

.modal-content p {
    color: var(--medium-grey);
    margin-bottom: 20px;
}

.modal-content .fa-tools {
    color: var(--primary-blue);
}

.modal img.large-profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button-no-abs{
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
}

.close-button:hover,
.close-button:focus,
.close-button-no-abs:hover,
.close-button-no-abs:focus
{
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.button-primary {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.button-primary:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.button-primary.danger{
    background-color: #c60101;
}

.button-primary:disabled{
    background-color: #7b7b7b;
    color: var(--white);
    cursor: not-allowed;
}

.button-secondary {
    width: 100%;
    padding: 15px;
    background-color: var(--light-grey);
    /*color: var(--white);*/
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.new-member-list .member img{
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.new-member-list .member {
    position: relative;
    display: flex; /* Make .member a flex container */
    align-items: center; /* Vertically centers items within .member */
    gap: 5px; /* Adds a small gap between the image and the text */
    border: 1px solid #ccc;
    border-radius: 50px;
    transition: background-color 0.3s ease; /* Optional: for a subtle hover effect on the member itself */
}

/* Optional: Subtle background change on member hover */
.new-member-list .member:hover {
    background-color: #f0f0f0;
}

.new-member-list .member span {
    font-size: 13px;
    margin-right: 10px;
    cursor: default;
}

.new-member-list{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.new-member-list .member .close-btn {
    position: absolute; /* Position relative to .member */
    top: 8px; /* Adjust to move it up */
    right: 8px; /* Adjust to move it right */
    cursor: pointer;
    font-size: 14px; /* Size of the 'x' icon */
    color: white; /* Color of the 'x' icon */
    width: 20px; /* Make it circular */
    height: 20px; /* Make it circular */
    border-radius: 50%; /* Make it circular */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Circular gradient shadow */
    background: radial-gradient(circle at center, rgba(0, 0, 0, 1.0) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* A subtle box shadow for depth */
    opacity: 0; /* Hide by default */
    pointer-events: none; /* Prevents interaction when hidden */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth transition */
    transform: scale(0.8); /* Start slightly smaller for pop effect */
}

.new-member-list .member:hover .close-btn {
    opacity: 1; /* Show on member hover */
    pointer-events: all; /* Enable interaction */
    transform: scale(1); /* Return to original size */
}

.new-member-list .member .close-btn:hover {
    /* Optional: further styling on close button hover */
    background: radial-gradient(circle at center, rgba(255, 0, 0, 1.0) 0%, rgba(255, 0, 0, 0.7) 70%, transparent 100%);
    transform: scale(1.1); /* Slightly enlarge on its own hover */
}

.new-room-button{
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.4em 0.9em 0.4em 0.9em;
    border-radius: 1em;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.new-room-button:hover{
    background-color: #0056b3;
}

.options-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position it below the ellipsis icon */
    right: 0; /* Align to the right of the ellipsis icon */
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure it appears above other content */
    min-width: 150px;
}

.options-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.options-menu li {
    border-bottom: 1px solid #eee;
}

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

.options-menu .option-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    white-space: nowrap; /* Prevent options from wrapping */
}

.options-menu .option-item:hover {
    background-color: #f0f0f0;
}

.options-menu .option-item.disabled{
    color: #aaa;
    cursor: not-allowed;
    pointer-events: none;
    background-color: transparent;
}

/* Class to show the menu */
.options-menu.show {
    display: block;
}

/* ========== TYPING INDICATOR ========== */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75em;
    color: var(--medium-grey);
    font-style: italic;
    padding: 4px 0;
}

.typing-indicator.group-typing {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 6px 12px;
    font-style: normal;
    font-size: 0.85em;
}

.typing-avatars {
    display: inline-flex;
    align-items: center;
}

.typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: -8px;
    animation: typing-bounce 0.6s ease-out;
}

.typing-avatar:first-child {
    margin-left: 0;
}

.typing-avatar:last-child {
    margin-right: 4px;
}

.typing-overflow {
    font-size: 12px;
    color: var(--medium-grey);
    margin-left: 4px;
    font-style: italic;
}

.typing-text {
    font-size: 0.9em;
    color: var(--medium-grey);
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    background: var(--light-grey, #f0f0f0);
    border-radius: 12px;
    animation: typing-fade-in 0.3s ease-out;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--medium-grey);
    border-radius: 50%;
    animation: typing-bounce-dot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes typing-bounce-dot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

@keyframes typing-fade-in {
    0% { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}
/* ========== END TYPING INDICATOR ========== */

/* ========== KEY MANAGEMENT PANEL ========== */

#key-management-panel {
    flex-direction: column;
}

#key-management-panel .panel-header {
    padding: 1em;
    border-bottom: 1px solid var(--border-color);
}

#key-management-panel .panel-header h2 {
    margin: 0;
    font-size: 1.2em;
}

#key-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.75em 1em;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.key-item:hover {
    background: var(--light-grey);
}

.key-item.highlighted {
    animation: key-highlight-pulse 1.5s ease-out;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

@keyframes key-highlight-pulse {
    0% { background: #e7f3ff; box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3); }
    100% { background: var(--white); box-shadow: none; }
}

.key-version-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1em;
    flex-shrink: 0;
}

.key-info {
    flex: 1;
    min-width: 0;
}

.key-info .key-created-at {
    font-size: 0.8em;
    color: var(--medium-grey);
}

.key-info .key-status {
    font-size: 0.75em;
    font-weight: 500;
    margin-top: 2px;
}

.key-info .key-status.unlocked {
    color: var(--online-green);
}

.key-info .key-status.locked {
    color: var(--medium-grey);
}

.key-lock-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
    flex-shrink: 0;
}

.key-lock-btn:hover {
    background: var(--light-grey);
}

.key-lock-btn i {
    font-size: 1.1em;
}

.key-lock-btn.locked i {
    color: var(--medium-grey);
}

.key-lock-btn.unlocked i {
    color: var(--online-green);
}

.key-management-empty {
    text-align: center;
    padding: 2em;
    color: var(--medium-grey);
}

/* ========== PIN ENTRY MODAL ========== */

.pin-modal-content {
    max-width: 380px;
    text-align: center;
}

.pin-modal-content h2 {
    margin: 0.5em 0 0.25em;
}

.pin-modal-content p {
    color: var(--medium-grey);
    font-size: 0.9em;
    margin-bottom: 1.5em;
}

.pin-modal-icon {
    margin-bottom: 0.5em;
}

.otp-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1.5em;
}

.otp-input {
    width: 40px;
    height: 48px;
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s;
    inputmode: numeric;
}

.otp-input:focus {
    border-color: var(--primary-blue);
}

.otp-separator {
    color: var(--medium-grey);
    font-size: 1.2em;
    margin: 0 2px;
}

#pin-unlock-btn {
    width: 100%;
    padding: 0.75em;
}

#pin-unlock-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pin-status-message {
    margin-top: 0.75em;
    font-size: 0.85em;
    min-height: 1.2em;
}

#pin-status-message.error {
    color: #dc3545;
}

#pin-status-message.success {
    color: var(--online-green);
}

/* ========== DECRYPT FAILED STATE ========== */

.decrypt-failed {
    color: var(--medium-grey);
    font-style: italic;
}

.decrypt-failed .fa-lock {
    margin-right: 4px;
}

.decrypt-retry-link {
    color: var(--primary-blue);
    text-decoration: underline;
    cursor: pointer;
    font-style: normal;
}

.decrypt-retry-link:hover {
    color: #0056b3;
}