:root {
    --wa-dark-green: #075E54;
    --wa-medium-green: #128C7E;
    --wa-light-green: #25D366;
    --wa-bg: #ECE5DD;
    --wa-bubble-out: #DCF8C6;
    --wa-bubble-in: #FFFFFF;
    --wa-text: #4A4A4A;
    --wa-gray: #929292;
    --wa-header-h: 60px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background-color: var(--wa-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Header Styles */
.wa-header {
    height: var(--wa-header-h);
    background-color: var(--wa-medium-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left i {
    font-size: 18px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #eee;
}

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

.sender-info h2 {
    font-size: 16px;
    font-weight: 600;
}

.sender-info .status {
    font-size: 11px;
    opacity: 0.8;
}

.header-right {
    display: flex;
    gap: 20px;
    font-size: 18px;
    opacity: 0.9;
}

/* Chat Area Styles */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
    background-size: contain;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-badge {
    background-color: #D1E4E8;
    color: #5B7276;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 7px;
    align-self: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Bubbles */
.bubble {
    max-width: 85%;
    padding: 8px 10px 25px 10px;
    border-radius: 8px;
    position: relative;
    font-size: 14.5px;
    line-height: 1.4;
    color: var(--wa-text);
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.bubble.received {
    align-self: flex-start;
    background-color: var(--wa-bubble-in);
    border-top-left-radius: 0;
}

.bubble.received::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px;
    border-width: 0 10px 10px 0;
    border-style: solid;
    border-color: transparent var(--wa-bubble-in) transparent transparent;
}

.text-content {
    font-size: 14.2px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* List Styling for "Rapi" effect */
.list-item {
    display: flex;
    align-items: flex-start;
    margin: 0;
}
.list-num {
    min-width: 22px;
    font-weight: bold;
    flex-shrink: 0;
}
.list-text {
    flex: 1;
}

.bubble.sent {
    align-self: flex-end;
    background-color: var(--wa-bubble-out);
    border-top-right-radius: 0;
}

.timestamp {
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 10px;
    color: var(--wa-gray);
}

.bubble.sent .timestamp {
    display: flex;
    align-items: center;
    gap: 3px;
}

.bubble.sent .timestamp i {
    color: #4fc3f7;
}

/* Bukti Transfer Styling */
.media-container {
    margin-bottom: 8px;
    border-radius: 5px;
    overflow: hidden;
}

.media-container img {
    width: 100%;
    display: block;
    cursor: pointer;
}

/* Document Attachment Styling */
.document-container {
    display: flex;
    align-items: center;
    background-color: #f7f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--wa-text);
    gap: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.doc-icon {
    width: 40px;
    height: 40px;
    background-color: #f15c5c; /* PDF Red */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.doc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doc-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-size {
    font-size: 11px;
    color: var(--wa-gray);
}

.doc-download {
    color: var(--wa-gray);
    font-size: 16px;
}

/* Footer / Input Bar */
.wa-input-container {
    padding: 10px 8px;
    background-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.input-actions {
    flex: 1;
    background-color: white;
    border-radius: 25px;
    display: flex;
    align-items: center;
    padding: 5px 12px;
    gap: 12px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.input-actions i {
    color: var(--wa-gray);
    font-size: 20px;
    cursor: pointer;
}

.input-actions input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 15px;
    background: transparent;
}

.send-btn {
    width: 45px;
    height: 45px;
    background-color: var(--wa-medium-green);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}

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

.send-btn i {
    margin-left: -2px; /* Adjust for paper-plane icon centering */
}

/* Loading/Error */
.loading-state, .error-state {
    text-align: center;
    padding: 40px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    align-self: center;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2100;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

/* Make image clickable */
.media-container img {
    cursor: pointer;
    transition: opacity 0.2s;
}

.media-container img:hover {
    opacity: 0.95;
}
