:root {
    --whatsapp-green: #468fea;
    --whatsapp-light-green: #1b2d62;
    --background-color: #f0f2f5;
    --chat-background: #E5DDD5;
    --sent-bubble-color: #DCF8C6;
    --received-bubble-color: #FFFFFF;
}

body {
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 50%;
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    width: 100%;
    margin-right: auto!important;
    margin-left: auto!important;
    padding:0;
}

.main-header {
    background-color: var(--whatsapp-green);
    color: white;
}

.main-header .navbar-brand {
    font-weight: 600;
}

.nav-tabs .nav-link {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.8rem 0.8rem;
}

.nav-tabs .nav-link.active {
    color: white;
    background-color: transparent;
    border-color: var(--whatsapp-light-green);
}

.tab-content {
    flex-grow: 1;
    overflow-y: auto;
    background-color: white;
    height: calc(100vh - 120px);
}

.list-group-item {
    cursor: pointer;
}

.list-group-item:hover {
    background-color: #f5f5f5;
}

.chat-list-item .last-message {
    font-size: 0.9rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70vw; 
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-image: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
    background-repeat: repeat;
    height: 100vh;
}

.chat-header {
    background-color: var(--whatsapp-light-green);
    color: white;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chat-header .user-info {
    display: flex;
    flex-direction: column;
    margin-left: 1rem;
}
.chat-header .user-info .user-name {
    font-weight: 600;
}
.chat-header .user-info .user-status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}
.chat-header #whatsapp-link {
    font-size: 1.2rem;
    text-decoration: none;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto; 
    padding: 1rem;
    display: flex;
    flex-direction: column;
    padding-bottom: 120px;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    position: relative;
}

.chat-bubble.sent {
    background-color: var(--sent-bubble-color);
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble.received {
    background-color: var(--received-bubble-color);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble img.chat-image {
    max-width: 100%;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.25rem;
}

.chat-timestamp {
    font-size: 0.7rem;
    color: #a0aec0;
    margin-right: 5px;
}

.read-receipt {
    font-size: 0.9rem;
    color: #a0aec0;
}
.read-receipt.read {
    color: #34b7f1;
}

.date-separator {
    align-self: center;
    background-color: #e1f2fb;
    color: #5a7a8a;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin: 10px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.chat-input-area {
    z-index: 9999;
    position: relative;
}

.chat-form {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 5px;
    width: 40%;
    margin: auto;
    padding: 5px 10px;
    display: flex;
    align-items: center;
}
.chat-form .input-group {
    flex-grow: 1;
}
.chat-form input {
    border-radius: 1.5rem !important;
}
.chat-form input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}
.chat-form button {
    border-radius: 50% !important;
    margin-left: 0.5rem;
    background-color: var(--whatsapp-light-green);
    border-color: var(--whatsapp-light-green);
}
.chat-form button:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1060;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

.chat-list-item.unread .last-message,
.chat-list-item.unread .chat-list-name,
.chat-list-item.unread .chat-list-timestamp {
    font-weight: 700;
    color: #000;
}
.unread-indicator {
    width: 10px;
    height: 10px;
    background-color: var(--whatsapp-light-green);
    border-radius: 50%;
    margin-top:2px;
}
.btn-dark {
    background: none;
    border: none;
}
.btn-dark:hover {
    background: none;
    border: none;
    color:#eee;
}
.custom-css-1 {
    border-radius: 0 0 1rem 1rem;
    border: none;
    box-shadow: 0 0 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.main-header {
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 0 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Styling Form Drawer */
#emergency-form {
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 800px;
    padding-bottom: 30px !important;
}
#emergency-form.collapsed {
    max-height: 25px;
    padding-top: 0 !important;
}
#emergency-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#emergency-form.collapsed #emergency-content {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}
.drag-handle-container {
    position: absolute;
    bottom: 0; 
    left: 0;
    right: 0;
    height: 25px;
    background-color: #f8f9fa; 
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.02);
}
.drag-handle-bar {
    width: 40px;
    height: 5px;
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* Indikator Online */
.online-indicator {
    width: 12px;
    height: 12px;
    background-color: #25D366; /* Hijau WhatsApp */
    border: 2px solid white;
    border-radius: 50%;
    display: inline-block;
}
.offline-indicator {
    width: 12px;
    height: 12px;
    background-color: #94a3b8; /* Abu-abu */
    border: 2px solid white;
    border-radius: 50%;
    display: inline-block;
}

/* Premium Overlay Blur */
.premium-locked {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}
.premium-overlay-container {
    position: absolute;
    top: 60px;
    left: 0;
    padding:25px;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
}
.premium-banner {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

@media(max-width:767px){
    #show-on-desk {display:none;}
    body {
        max-width: 100%;
        --bs-gutter-x: 1.5rem;
        --bs-gutter-y: 0;
        padding:0;
    }
    .chat-form {
        width:100%;
    }
    .main-header {
        border-radius:0!important;
    }
    #reply-preview-bar { width:100% !important; }
}

/* === TYPING INDICATOR === */
.typing-indicator-bubble {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 14px;
    background: #fff; border-radius: 12px; border-bottom-left-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    width: fit-content;
}
.typing-dot {
    width: 7px; height: 7px;
    background: #90949c; border-radius: 50%;
    animation: typingBounce 1.2s 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 typingBounce {
    0%,60%,100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* === REPLY BAR === */
#reply-preview-bar {
    position: fixed; bottom: 62px; left: 0; right: 0;
    width: 40%; margin: auto;
    background: #f0f2f5; border-left: 4px solid #468fea;
    padding: 6px 12px; border-radius: 0 6px 6px 0;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 9998; box-shadow: 0 -1px 4px rgba(0,0,0,0.06);
}
.reply-bubble {
    background: rgba(70,143,234,0.08); border-left: 3px solid #468fea;
    border-radius: 4px; padding: 4px 8px; margin-bottom: 5px;
}
.reply-bubble .reply-sender { color: #468fea; font-weight: 600; font-size: 0.78rem; display: block; }
.reply-bubble .reply-text  { color: #555; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; display: block; }

/* === EMOJI REACTIONS === */
.emoji-picker-popup {
    position: absolute; bottom: calc(100% + 4px); left: 0;
    background: white; border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 6px 12px; display: flex; gap: 10px; z-index: 200;
}
.sent .emoji-picker-popup { left: auto; right: 0; }
.emoji-picker-popup span { font-size: 1.4rem; cursor: pointer; transition: transform 0.1s; }
.emoji-picker-popup span:hover { transform: scale(1.35); }
.reactions-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.reaction-badge {
    background: #f0f2f5; border-radius: 12px; padding: 2px 8px;
    font-size: 0.78rem; cursor: pointer; border: 1px solid #e2e8f0;
    transition: background 0.15s; user-select: none;
}
.reaction-badge:hover, .reaction-badge.mine { background: #dbeafe; border-color: #93c5fd; }

/* === VOICE NOTE === */
.voice-note-player { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.voice-note-player audio { max-width: 190px; height: 32px; }
#record-btn.recording {
    background-color: #ef4444 !important; border-color: #ef4444 !important;
    animation: pulseMic 1s infinite;
}
@keyframes pulseMic {
    0%,100% { opacity: 1; } 50% { opacity: 0.55; }
}
#record-timer { font-size: 0.72rem; color: #ef4444; font-weight: 700; min-width: 32px; }

/* === COACH PROFILE MODAL === */
.coach-profile-tags .badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; }
.availability-slot {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 8px; padding: 3px 10px; font-size: 0.78rem; color: #166534;
    display: inline-block; margin: 2px;
}
.review-card {
    background: #f9fafb; border-radius: 10px; padding: 10px 14px;
    margin-bottom: 8px; border: 1px solid #f3f4f6;
}

/* === STAR RATING === */
.star-display { color: #f59e0b; }
.star-display .empty { color: #d1d5db; }
.rating-stars-input span {
    font-size: 2.2rem; cursor: pointer;
    color: #d1d5db; transition: color 0.15s; line-height: 1;
}
.rating-stars-input span.active { color: #f59e0b; }

/* Sembunyikan teks secara default */
.nav-link-dynamic .tab-text {
    display: none;
    transition: opacity 0.3s ease;
}

/* Tampilkan teks hanya jika tab sedang aktif */
.nav-link-dynamic.active .tab-text {
    display: inline-block;
}

/* Atur margin ikon agar pas posisinya di tengah saat tidak ada teks */
.nav-link-dynamic i {
    margin-right: 0 !important;
    font-size: 16px;
}

/* Berikan jarak (margin-right) ke ikon saat teks muncul */
.nav-link-dynamic.active i {
    margin-right: 0.3rem !important; 
}
#coachProfileTabsContent {height:auto;}
.nav-link.active span,
.nav-link.active i {
    color: #ffffff;
}