/* ========================================================
   Dhamma Mobile-First Web Application Stylesheet
   Implements a clean, native iOS/Android feel for Myanmar users
   ======================================================== */

/* Embed Local Myanmar Unicode Webfont (Pyidaungsu) */
@font-face {
    font-family: 'Pyidaungsu';
    src: url('../webfonts/Pyidaungsu.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset & Base Fonts */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Pyidaungsu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #e5e5e7; /* Light grey desktop background */
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    transition: background-color 0.3s;
}

/* Force Pyidaungsu font family on all inputs/controls */
input, select, textarea, button, .form-control, .form-select, .btn {
    font-family: 'Pyidaungsu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Device Centering Wrapper (Simulates mobile screen on desktop) */
.mobile-viewport-wrapper {
    width: 100%;
    max-width: 480px; /* Standard smartphone size */
    min-height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.12);
    overflow-x: hidden;
    transition: background-color 0.3s;
}

@media (max-width: 480px) {
    .mobile-viewport-wrapper {
        box-shadow: none;
    }
}

/* 1. App Top Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.app-header-logo-icon {
    font-size: 1.4rem;
    color: #ffd700;
    display: inline-flex;
    align-items: center;
}

.app-header-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-tiny-link {
    opacity: 0.6;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}
.admin-tiny-link:hover {
    opacity: 1;
}

.header-icon-link {
    position: relative;
    text-decoration: none;
    color: inherit;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.2s;
}

.header-icon-link:active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(0.96);
}

.notification-bell-link i,
.admin-tiny-link i {
    font-size: 1.45rem !important;
    line-height: 1;
}

.header-bell-icon,
.header-lock-icon {
    font-size: 1.45rem !important;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff5b5b;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 6px 14px rgba(255, 91, 91, 0.25);
}

/* 2. Main Content Body */
.app-content-body {
    flex-grow: 1;
    padding: 16px 16px 95px 16px !important; /* Large bottom padding to accommodate bottom nav + FAB */
}

/* 3. Bottom Navigation Bar */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 72px;
    background-color: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    z-index: 999;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s, border-color 0.3s;
}

.bottom-nav-bar .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    width: 20%;
    height: 100%;
    transition: all 0.2s ease;
}

.bottom-nav-bar .nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.bottom-nav-bar .nav-item:hover,
.bottom-nav-bar .nav-item.active {
    color: var(--primary-color);
}

/* Floating Action Button (FAB) */
.fab-wrapper {
    position: relative;
    top: -24px; /* Elevate the button */
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
}

.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 6px 16px rgba(197, 155, 39, 0.35);
    border: 4px solid #ffffff;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-btn:hover,
.fab-btn:active {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(197, 155, 39, 0.5);
}

.fab-label {
    font-size: 0.65rem;
    color: var(--text-color);
    margin-top: 4px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

/* 4. Dashboard & Card Styling */
.dhamma-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    overflow: hidden;
}

.dhamma-card:active {
    transform: scale(0.98);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    height: 140px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
}

.category-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background-color: rgba(197, 155, 39, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.category-card:hover .category-icon-wrapper {
    transform: scale(1.1);
    background-color: var(--primary-color);
    color: #ffffff;
}

.category-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

/* Daily Verse / Feature Banner Card */
.feature-banner {
    background: linear-gradient(135deg, #4a3319 0%, #2c1e05 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.feature-banner-accent {
    position: absolute;
    right: 15px;
    bottom: 10px;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

/* 5. List View Styles */
.custom-list-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-list-item {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid rgba(0, 0, 0, 0.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.2s, background-color 0.3s;
}

.custom-list-item:active {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.list-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}

.list-item-arrow {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* 6. Dhamma Reader Styling */
.reader-container {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s;
}

.reader-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.reader-body-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: inherit;
    white-space: pre-wrap;
    transition: font-size 0.2s ease;
}

/* Text Size Control Panel */
.text-size-control {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 30px;
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.3s;
}

.text-size-btn {
    border: none;
    background: none;
    color: inherit;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
}

.text-size-btn:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Favorite/Heart Toggle on Detail Page */
.favorite-toggle-btn {
    background: none;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}
.favorite-toggle-btn:active {
    transform: scale(1.2);
    background-color: rgba(255, 59, 48, 0.1);
}

/* 7. Audio Player Styling */
.audio-player-card {
    background: linear-gradient(135deg, #faf6eb 0%, #f0e6cc 100%);
    border-radius: 16px;
    border: 1px solid rgba(197, 155, 39, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s, border-color 0.3s;
}

.custom-audio-element {
    width: 100%;
    height: 40px;
    outline: none;
}

/* 8. Admin & Login Layouts */
.login-card {
    background-color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0,0,0,0.02);
}

.login-icon-box {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 16px auto;
    box-shadow: 0 4px 15px rgba(197, 155, 39, 0.3);
}

.form-control-custom {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.12);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
    outline: none;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(197, 155, 39, 0.2);
    transition: all 0.2s;
}

.btn-primary-custom:hover,
.btn-primary-custom:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(197, 155, 39, 0.35);
}

.badge-secured {
    background-color: #e5e5e7;
    color: #636366;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Admin Table & Action Buttons */
.admin-table-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    overflow: hidden;
}

.table th {
    background-color: rgba(197, 155, 39, 0.05);
    color: var(--text-color);
    font-weight: 700;
    font-size: 0.85rem;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.color-preview {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #ffffff;
    box-shadow: 0 0 4px rgba(0,0,0,0.25);
}

.notification-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-page-hero {
    padding: 18px 18px 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(197, 155, 39, 0.16) 0%, rgba(255, 255, 255, 0.88) 100%);
    border: 1px solid rgba(197, 155, 39, 0.12);
    box-shadow: 0 12px 28px rgba(44, 30, 5, 0.06);
    margin-bottom: 16px;
}

.message-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(44, 30, 5, 0.08);
    flex-shrink: 0;
}

.message-back-btn:active {
    transform: scale(0.96);
}

.message-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(197, 155, 39, 0.12);
    color: var(--primary-color);
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.message-hero-title {
    font-size: 1.08rem;
    line-height: 1.35;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 8px;
}

.message-hero-text {
    font-size: 0.84rem;
    line-height: 1.7;
    color: rgba(44, 30, 5, 0.74);
}

.message-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.message-hero-stat {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(197, 155, 39, 0.1);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.message-hero-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-color);
}

.message-hero-stat-label {
    font-size: 0.7rem;
    color: rgba(44, 30, 5, 0.65);
}

.notification-card {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(44, 30, 5, 0.07);
    border: 1px solid rgba(197, 155, 39, 0.08);
}

.notification-card.is-new {
    border-color: rgba(197, 155, 39, 0.28);
    box-shadow: 0 12px 34px rgba(197, 155, 39, 0.14);
}

.notification-card-glow {
    position: absolute;
    inset: auto -24px -24px auto;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(197, 155, 39, 0.12) 0%, rgba(197, 155, 39, 0) 70%);
    pointer-events: none;
}

.notification-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.45;
}

.notification-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(197, 155, 39, 0.12);
    color: var(--primary-color);
    font-size: 0.68rem;
    font-weight: 700;
}

.notification-icon-shell {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(197, 155, 39, 0.12) 0%, rgba(163, 123, 25, 0.18) 100%);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f7f4ea;
    color: rgba(44, 30, 5, 0.72);
    font-size: 0.72rem;
    font-weight: 600;
}

.notification-meta-chip i {
    color: var(--primary-color);
    font-size: 0.72rem;
}

.notification-image-wrap {
    margin: 12px 0;
    border-radius: 18px;
    overflow: hidden;
    background: #f7f4ea;
    border: 1px solid rgba(197, 155, 39, 0.08);
}

.notification-image {
    width: 100%;
    display: block;
    max-height: 260px;
    object-fit: cover;
}

.notification-body-card {
    background: linear-gradient(180deg, rgba(250, 246, 235, 0.8) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-radius: 18px;
    padding: 10px 12px 10px;
    border: 1px solid rgba(197, 155, 39, 0.08);
    text-align: left;
}

.notification-body-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0;
    line-height: 1;
    margin-top: 6px;
}

.notification-body {
    color: var(--text-color);
    font-size: 0.93rem;
    line-height: 1.72;
    white-space: pre-line;
    text-align: left;
    margin: 2px 0 0;
    width: 100%;
    word-break: break-word;
}

.message-empty-state {
    background: #ffffff;
    border-radius: 22px;
    padding: 36px 22px;
    text-align: center;
    box-shadow: 0 12px 28px rgba(44, 30, 5, 0.06);
    border: 1px solid rgba(197, 155, 39, 0.08);
}

.message-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 14px;
    background: rgba(197, 155, 39, 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.notification-admin-preview {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 10px;
    background: #faf9f6;
}

.notification-admin-preview-image {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* ========================================================
   9. Interactive Digital Beads (Rosary Counter)
   ======================================================== */
.bead-counter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
}

.bead-ring-outer {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 8px dashed rgba(197, 155, 39, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 25px;
}

.bead-tap-zone {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(197, 155, 39, 0.4);
    cursor: pointer;
    user-select: none;
    transition: transform 0.08s ease-in-out;
}

.bead-tap-zone:active {
    transform: scale(0.94);
    box-shadow: 0 5px 12px rgba(197, 155, 39, 0.3);
}

.bead-count-display {
    font-size: 3.4rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -1px;
}

.bead-count-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.bead-stats-grid {
    display: flex;
    width: 100%;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.bead-stat-box {
    flex: 1;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: background-color 0.3s;
}

.bead-stat-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.bead-stat-lbl {
    font-size: 0.68rem;
    color: #8e8e93;
    font-weight: 600;
}

/* ========================================================
   10. Dark Mode Colors Overrides
   ======================================================== */
body.dark-theme {
    background-color: #0c0c0e;
    color: #e5e5ea;
}

body.dark-theme .mobile-viewport-wrapper {
    background-color: #151517;
}

body.dark-theme .dhamma-card,
body.dark-theme .custom-list-item,
body.dark-theme .reader-container,
body.dark-theme .bead-stat-box,
body.dark-theme .admin-table-card,
body.dark-theme .login-card {
    background-color: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .bottom-nav-bar {
    background-color: #1c1c1e;
    border-top-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

body.dark-theme .text-dark,
body.dark-theme .list-item-title,
body.dark-theme .bead-stat-num {
    color: #ffffff !important;
}

body.dark-theme .text-muted,
body.dark-theme .bead-stat-lbl {
    color: #98989d !important;
}

body.dark-theme .bg-light,
body.dark-theme .btn-light,
body.dark-theme .text-size-control,
body.dark-theme .table-responsive th,
body.dark-theme .category-icon-wrapper {
    background-color: #2c2c2e !important;
    color: #e5e5ea !important;
    border-color: rgba(255,255,255,0.08) !important;
}

body.dark-theme .audio-player-card {
    background: linear-gradient(135deg, #2c2c2e 0%, #1e1e20 100%);
    border-color: rgba(197, 155, 39, 0.3);
}

body.dark-theme .fab-btn {
    border-color: #1c1c1e;
}

body.dark-theme .form-control-custom,
body.dark-theme .input-group-text,
body.dark-theme .form-select {
    background-color: #2c2c2e !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

