@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: #f0f2f5;
    --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;
}

.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;
}
.person-status {
    font-size: 14px;
    color: var(--medium-grey);
}
.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: 10%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-text {
    padding: 10px 15px;
    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: 5px;
}

.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;
}

.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;
}


.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: 20px;
}

.section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    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 0;
    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:hover,
.close-button: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-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;
}