* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans Lao', sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.app-header {
    background-color: #0d3b66;
    color: #ffffff;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.app-title {
    font-size: 22px;
    font-weight: bold;
    color: #f4d35e;
    letter-spacing: 1px;
}

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

.install-btn {
    background-color: #f4d35e;
    color: #0d3b66;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ຍ້າຍແຖບລົງມາໄວ້ລຸ່ມແບບ WhatsApp */
.app-bottom-nav {
    display: flex;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.app-bottom-nav .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.app-bottom-nav .tab i {
    font-size: 20px;
    margin-bottom: 4px;
}

.app-bottom-nav .tab.active {
    color: #0d3b66;
}

.app-bottom-nav .tab.active i {
    color: #0d3b66;
}

.tab-icon-wrapper {
    position: relative;
    display: inline-block;
}

.chat-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.text-green {
    color: #25d366 !important;
    font-weight: bold;
}

.text-bold {
    font-weight: 600;
    color: #111b21 !important;
}

.unread-badge-green {
    background-color: #25d366;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.badge-dot-main {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 10px;
    height: 10px;
    background-color: #25d366;
    border-radius: 50%;
    border: 2px solid white;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f8fafc;
}

.tab-content {
    display: none;
}

.tab-content.active-content {
    display: block;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
    background-color: #ffffff;
}

.chat-item:hover {
    background-color: #f1f5f9;
}

.special-chat {
    background-color: #e0f2fe;
    border-bottom: 1px solid #bae6fd;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    background-color: #0d3b66;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

.bg-gold {
    background-color: #f4d35e !important;
    color: #0d3b66 !important;
}

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

.chat-title-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.chat-title-row h4 {
    font-size: 15px;
    font-weight: 600;
    color: #0d3b66;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
    margin-left: 5px;
}

.chat-preview {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.divider-text {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: bold;
    color: #64748b;
    background-color: #f1f5f9;
}

.event-announcement-box {
    background-color: #ffffff;
    border-left: 4px solid #25d366;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.event-badge {
    display: inline-block;
    background-color: #e8fbf0;
    color: #25d366;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.event-info-table, .event-tools-table, .agenda-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
}

.event-info-table td {
    padding: 4px 2px;
    vertical-align: top;
}

.event-info-table td:first-child {
    width: 30%;
    color: #0d3b66;
}

.event-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #0d3b66;
    margin-top: 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.event-detail-p {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 8px;
}

.event-tools-table th, .event-tools-table td, .agenda-table td {
    border: 1px solid #e2e8f0;
    padding: 6px;
    text-align: left;
}

.event-tools-table th {
    background-color: #f8fafc;
    color: #0d3b66;
}

.agenda-day-title {
    font-size: 12px;
    font-weight: bold;
    background: #e0f2fe;
    color: #0d3b66;
    padding: 6px 8px;
    margin-top: 12px;
    border-radius: 4px;
}

.agenda-table td:first-child {
    width: 25%;
    font-weight: bold;
    color: #64748b;
}

/* Embedded Form styles */
.iframe-container {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    margin-top: 10px;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
}

.register-link-btn {
    display: inline-block;
    background-color: #0d3b66;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    margin-top: 10px;
}

.register-link-btn:hover {
    background-color: #1a5c99;
}

/* Feeds Zone Updates */
.feed-card {
    background: #ffffff;
    margin: 12px;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.highlight-card {
    border: 1px solid #25d366;
    background-color: #f6fff9;
}

.badge-event {
    background-color: #25d366;
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    margin-right: 4px;
}

.event-title-text {
    color: #0d3b66;
    font-size: 15px;
    margin-bottom: 6px;
}

.feed-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    background: #f4d35e;
    color: #0d3b66;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
}

.feed-user-info h5 {
    font-size: 14px;
    color: #0d3b66;
}

.feed-user-info span {
    font-size: 11px;
    color: #94a3b8;
}

.feed-body p {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
}

.mobile-pwa-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-radius: 12px;
    z-index: 2000;
    border: 1px solid #e2e8f0;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { bottom: -100px; opacity: 0; }
    to { bottom: 80px; opacity: 1; }
}

.popup-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.popup-icon {
    font-size: 35px;
    color: #0d3b66;
    margin-bottom: 10px;
}

.popup-text h3 {
    font-size: 16px;
    color: #0d3b66;
    margin-bottom: 4px;
}

.popup-text p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 15px;
}

.popup-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.popup-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.btn-confirm {
    background: #0d3b66;
    color: #ffffff;
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #efeae2;
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.modal.active {
    transform: translateX(0);
}

.modal-header {
    background: #0d3b66;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
}

.close-modal {
    margin-right: 15px;
    cursor: pointer;
    font-size: 18px;
}

.modal-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.system-msg {
    align-self: center;
    background: #d9dbde;
    color: #4a4a4a;
    font-size: 12px;
    text-align: center;
}

.received {
    align-self: flex-start;
    background: white;
    border-bottom-left-radius: 0;
    width: 100%;
    max-width: 95%;
}

.modal-footer {
    padding: 10px;
    background: #f0f0f0;
    display: flex;
    gap: 10px;
}

.modal-footer input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    outline: none;
}

.send-btn {
    background: #0d3b66;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}