/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* stop Android/iOS auto-inflating ("boosting") text on mobile */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bcw-1);
    color: var(--bcw-8);
    padding-top: 60px;
    padding-bottom: 50px;
}
/*
this is from theme.php
:root {
    --bcw-1: #f0f2f5;
    --bcw-2: #eaf2f8;
    --bcw-3: #d4e6f6;
    --bcw-4: #aed6f1;
    --bcw-5: #2e86c1;
    --bcw-6: #1a6da0;
    --bcw-7: #1a5276;
    --bcw-8: #333;
    --bcw-9: #666;
    --bcw-10: #eee;
    --bcw-white: #fff;
    --bcw-overlay: rgba(0, 0, 0, 0.5);
}
*/
/* ========== TITLE BAR ========== */
.title-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--bcw-7), var(--bcw-5));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* NEW: */
.title-bar-left {
    /*width: 20px;*/
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-bar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}
.title-bar-center {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-icon,
.profile-icon {
    font-size: 24px;
    color: var(--bcw-white);
    cursor: pointer;
    transition: color 0.2s;
}

.menu-icon:hover,
.profile-icon:hover {
    color: var(--bcw-4);
}

.title-bar-center h1 {
    color: var(--bcw-white);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

/* ========== SIDE MENU ========== */
.side-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.side-menu.active {
    display: block;
}

.side-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bcw-overlay);
}

.side-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bcw-white);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--bcw-7), var(--bcw-5));
    color: var(--bcw-white);
}

.side-menu-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.close-menu {
    font-size: 22px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-menu:hover {
    color: var(--bcw-4);
}

.side-menu-nav {
    padding: 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--bcw-8);
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
}

.menu-item:hover {
    background: var(--bcw-2);
    color: var(--bcw-5);
}

.menu-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ========== PROFILE DROPDOWN ========== */
.profile-dropdown {
    display: none;
    position: fixed;
    top: 60px;
    right: 10px;
    background: var(--bcw-white);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    min-width: 200px;
    overflow: hidden;
}

.profile-dropdown.active {
    display: block;
    animation: fadeDown 0.2s ease;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--bcw-8);
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s;
}

.profile-item:hover {
    background: var(--bcw-2);
    color: var(--bcw-5);
}

.profile-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== SECTION HEADER ========== */
.content-section {
    margin-bottom: 30px;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--bcw-7);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    font-size: 20px;
    color: var(--bcw-5);
}

.section-header .home-link {
    margin-left: auto;
    font-size: 12px;
    color: var(--bcw-5);
    text-decoration: none;
    padding: 2px 5px;
    border-radius: 15px;
    background: var(--bcw-3);
}
.section-header .home-link:hover {
    background: var(--bcw-5);
    color: #fff;
}



/* ========== CARDS GRID ========== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ========== CARD ========== */
.card {
    background: var(--bcw-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.advertise-this {
	position: relative;
    overflow: hidden;
    border: 3px solid var(--bcw-8);
    background: var(--bcw-3);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
}

@keyframes blinkStar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.star-blink {
    color: var(--bcw-8);
    font-size: 14px;
    animation: blinkStar 1.2s ease-in-out infinite;
    margin-left: 4px;
}



.card-media {
    width: 100%;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 160px;
    max-height: 220px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.card-body {
    padding: 14px 16px 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--bcw-7);
    margin-bottom: 8px;
    line-height: 1.3;
    text-align: justify;
}

.card-description {
    font-size: 14px;
    color: var(--bcw-9);
    line-height: 1.5;
    margin-bottom: 6px;
    text-align: justify;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--bcw-10);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-action:active {
    transform: scale(0.97);
}

.btn-download {
    background: var(--bcw-5);
    color: var(--bcw-white);
}

.btn-download:hover {
    background: var(--bcw-6);
}

.btn-more {
    background: var(--bcw-2);
    color: var(--bcw-5);
}

.btn-more:hover {
    background: var(--bcw-3);
}

/* ========== BOTTOM BAR ========== */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(-180deg, var(--bcw-7), var(--bcw-8), var(--bcw-9));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.bottom-bar p {
    color: var(--bcw-white);
    font-size: 13px;
    text-align: center;
    opacity: 0.9;
}

/* ========== RESPONSIVE: TABLET (>= 600px) ========== */
@media (max-width: 600px) {
				.nav-text { display: none; }
				.menu-item2 { padding: 2px 4px !important; font-size: 10px !important;  color: var(--bcw-3) !important;}
				.menu-item2 i { font-size: 12px !important; }
			}
			

@media (min-width: 600px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-title {
        font-size: 17px;
    }

    .main-content {
        padding: 20px;
    }

}

/* ========== RESPONSIVE: SMALL DESKTOP (>= 900px) ========== */
@media (min-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-content {
        padding: 24px 30px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .card-media img {
        max-height: 200px;
    }

}

/* ========== RESPONSIVE: LARGE DESKTOP (>= 1200px) ========== */
@media (min-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .main-content {
        padding: 28px 40px;
    }

    .card-media img {
        max-height: 180px;
    }

}

/* ========== SCROLLBAR STYLING ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bcw-1);
}

::-webkit-scrollbar-thumb {
    background: var(--bcw-5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bcw-7);
}

/* ==================================================================
   COMMON UTILITIES  (Bootstrap-like names / behaviour)
   Used by: appLogin.php, appChangePwd.php, appChangeProfile.php
   ================================================================== */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}

@media (min-width: 768px) {
    .container { max-width: 720px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}

.row > * {
    width: 100%;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
}

.col-12 {
    flex: 0 0 auto;
    width: 100%;
}

.d-flex { display: flex !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }

.text-center { text-align: center !important; }
.text-start { text-align: start !important; }
.text-decoration-none { text-decoration: none !important; }
.float-end { float: right !important; }

.p-0 { padding: 0 !important; }
.p-4 { padding: 1.5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }

/* ==================================================================
   COMMON COMPONENTS
   ================================================================== */
.card-header img {
    height: 36px;
    width: auto;
    display: block;
}

.card-header-brand {
    background: var(--bcw-3);
    color: var(--bcw-7);
    padding: 12px 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.card-header-brand h4 {
    color: var(--bcw-7);
    margin: 0;
    padding: 0;
    text-align: right;
    font-size: 16px;
}

.login-card .card-body,
.changepwd-card .card-body,
.profile-card .card-body {
    padding: 20px;
}

.form-control {
    display: block;
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    box-sizing: border-box;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.form-control:focus {
    outline: none;
    border-color: var(--bcw-5);
    box-shadow: 0 0 0 3px rgba(47, 134, 193, 0.15);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-select {
    display: block;
    width: 100%;
    height: 38px;
    padding: 6px 10px;
    font-size: 14px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.form-select:focus {
    outline: none;
    border-color: var(--bcw-5);
    box-shadow: 0 0 0 3px rgba(47, 134, 193, 0.15);
}

.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 8px;
    transition: opacity 0.15s ease;
}

.btn-main {
    background-color: var(--bcw-5);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
}

.btn-main:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
}

.btn-secondary-custom {
    background-color: #888;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
}

.btn-secondary-custom:hover {
    background-color: #666;
    color: #fff;
}

.btn-primary {
    background-color: var(--bcw-5);
    border-color: var(--bcw-5);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--bcw-6);
    border-color: var(--bcw-6);
    color: #fff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}

.btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
    color: #fff;
}

.btn-xs {
    padding: 3px 9px;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 4px;
}

#statusArea {
    min-height: 25px;
    font-size: 13px;
}

/* ==================================================================
   PAGE: appLogin.php
   ================================================================== */
.login-wrapper {
    max-width: 420px;
    margin: 0 auto;
    padding: 15px;
}

.login-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.login-card .mb-3,
.changepwd-card .mb-3 {
    margin-bottom: 12px !important;
    padding: 0;
}

.tab-btn {
    padding: 4px 7px;
    border: none;
    background: #e9ecef;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.tab-btn.active {
    background: var(--bcw-5);
    color: #fff;
}

.tab-content {
    display: none;
    padding: 6px 0 0 0;
}

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

.auto-login-btns {
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
}

.auto-login-btns .btn {
    white-space: nowrap;
    font-size: 12px;
}

/* ==================================================================
   PAGE: appChangePwd.php
   ================================================================== */
.changepwd-card {
    max-width: 480px;
    margin: 0 auto;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* ==================================================================
   PAGE: appChangeProfile.php
   ================================================================== */
.profile-card {
    max-width: 640px;
    margin: 0 auto;
    padding: 15px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.profile-card .card-header {
    background: linear-gradient(135deg, var(--bcw-1), var(--bcw-2));
    color: #fff;
    padding: 15px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.profile-card .card-header-brand {
    background: var(--bcw-3);
    color: var(--bcw-7);
}

.profile-card .card-header h4 {
    margin: 0;
    padding: 0;
    text-align: right;
    font-size: 18px;
}

.profile-card label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
    display: block;
    color: #333;
}

.profile-card input[type="text"],
.profile-card input[type="email"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.profile-card input:focus {
    outline: none;
    border-color: var(--bcw-5);
    background: #fff;
}

.msg-error {
    background: #f8d7da;
    color: #842029;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.msg-success {
    background: #d1e7dd;
    color: #0f5132;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.info-box {
    background: #f1f3f5;
    border: 1px dashed #adb5bd;
    border-radius: 8px;
    padding: 5px 6px;
    margin-bottom: 7px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 7px;
    font-size: 11px;
}

.info-box .itm b {
    color: #495057;
}

.info-box .itm span {
    color: #212529;
    font-weight: 600;
}

.row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--bcw-5);
    border-bottom: 2px solid var(--bcw-5);
    padding-bottom: 4px;
    margin: 14px 0 10px;
}

/* ==================================================================
   COMMON: master pages  (appEntry.php / appUser.php / appHead.php)
   ================================================================== */
.master-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.master-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--bcw-7);
}

.master-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.master-filters .form-select {
    max-width: 48%;
}

.master-form {
    background: var(--bcw-1);
    border: 1px dashed var(--bcw-4);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.form-full {
    grid-column: 1 / -1;
}

.master-form textarea.form-control {
    height: auto;
    min-height: 56px;
    resize: vertical;
}

.master-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.grid-wrap {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--bcw-10);
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    border: 1px solid var(--bcw-10);
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
}

.table thead th {
    background: var(--bcw-7);
    color: var(--bcw-white);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr:nth-child(even) {
    background: var(--bcw-1);
}

.table tbody tr:hover {
    background: var(--bcw-3);
}

.table td.num {
    text-align: right;
}

.master-grid .btn-xs + .btn-xs {
    margin-left: 4px;
}

@media (max-width: 600px) {
    .master-filters .form-select {
        max-width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================================================================
   DASHBOARD : priority bar chart  (appDashboard.php)
   ================================================================== */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 12px;
    height: 250px;
    padding-top: 4px;
}

.bar-item {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--bcw-7);
    white-space: nowrap;
    margin-bottom: 6px;
}

.bar-track {
    flex: 1;
    width: 100%;
    max-width: 76px;
    display: flex;
    align-items: flex-end;
    background: var(--bcw-1);
    border: 1px solid var(--bcw-3);
    border-bottom: 2px solid var(--bcw-5);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--bcw-4) 0%, var(--bcw-5) 100%);
    border-radius: 6px 6px 0 0;
}

.bar-fill.is-empty {
    background: var(--bcw-10);
    border-top: 2px dashed var(--bcw-4);
    border-radius: 0;
}

.bar-label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bcw-8);
}

.bar-count {
    font-size: 11px;
    color: var(--bcw-9);
}

.chart-summary {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--bcw-7);
}

.chart-summary span {
    font-size: 12px;
    font-weight: 400;
    color: var(--bcw-9);
}

@media (max-width: 600px) {
    .bar-chart {
        gap: 6px;
        height: 210px;
    }

    .bar-value {
        font-size: 11px;
    }

    .bar-label {
        font-size: 12px;
    }

    .bar-track {
        max-width: 52px;
    }
}

/* ==================================================================
   MOBILE TYPOGRAPHY  (<= 600px)
   Shrink the big text on phones. Inputs stay at 16px on purpose :
   anything smaller makes iOS Safari zoom the whole page on focus.
   ================================================================== */
@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .section-header h2 i {
        font-size: 16px;
    }

    .side-menu-header h2 {
        font-size: 17px;
    }

    .card-header-brand h4,
    .profile-card .card-header h4 {
        font-size: 15px;
    }

    .card-title {
        font-size: 15px;
    }

    .form-control,
    .form-select,
    textarea.form-control {
        font-size: 16px;
    }
}