/* ============================================
   YukDonasi - Main Stylesheet
   Style: Clean Kitabisa-like Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #00aeef;
    --primary-dark: #0098d4;
    --primary-light: #e8f7fd;
    --secondary: #ff6b35;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --dark: #222222;
    --gray-900: #333333;
    --gray-700: #555555;
    --gray-500: #888888;
    --gray-400: #aaaaaa;
    --gray-200: #e0e0e0;
    --gray-100: #f3f4f5;
    --white: #ffffff;
    --border: #eaeaea;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #e8e8e8;
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   App Container (Mobile Frame)
   ============================================ */
.app-container {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: var(--white);
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    background: var(--gray-100);
}

/* ============================================
   Header
   ============================================ */
.app-header-main {
    background: var(--white);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.app-header-main .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.app-header-main .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.app-header-main .header-actions a {
    color: var(--gray-700);
    font-size: 18px;
    margin-left: 16px;
    position: relative;
}

.app-header-main .header-actions .notif-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid var(--white);
}

.search-bar {
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--gray-200);
    border-radius: 24px;
    font-size: 13px;
    background: var(--gray-100);
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--primary);
    background: var(--white);
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 14px;
}

/* ============================================
   Inner Page Header (Back Button)
   ============================================ */
.page-header {
    background: var(--white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header .back-btn {
    color: var(--gray-900);
    font-size: 18px;
    margin-right: 14px;
    cursor: pointer;
}

.page-header h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Banner / Slider
   ============================================ */
.banner-slider {
    padding: 12px 16px;
    background: var(--white);
}

.banner-slider .carousel-inner {
    border-radius: var(--radius);
    overflow: hidden;
}

.banner-slider .carousel-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.carousel-indicators {
    margin-bottom: 6px;
}

.carousel-indicators button {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background-color: var(--white) !important;
    opacity: 0.5;
    border: none !important;
    margin: 0 3px !important;
}

.carousel-indicators button.active {
    opacity: 1;
    width: 18px !important;
    border-radius: 4px !important;
}

/* ============================================
   Quick Donate Bar
   ============================================ */
.quick-donate {
    background: var(--white);
    padding: 14px 16px;
    margin-top: 1px;
    border-bottom: 6px solid var(--gray-100);
}

.quick-donate .donate-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), #0098d4);
    color: var(--white);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
}

.quick-donate .donate-btn i {
    margin-right: 10px;
    font-size: 18px;
}

/* ============================================
   Section
   ============================================ */
.section {
    background: var(--white);
    padding: 16px;
    margin-bottom: 6px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title h6 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--gray-900);
}

.section-title a {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   Category Icons
   ============================================ */
.category-grid {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-grid::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
    cursor: pointer;
    text-decoration: none;
}

.category-item .cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    transition: transform 0.2s;
}

.category-item:hover .cat-icon {
    transform: scale(1.08);
}

.category-item .cat-icon i {
    font-size: 18px;
    color: var(--primary);
}

.category-item span {
    font-size: 11px;
    color: var(--gray-700);
    text-align: center;
    line-height: 1.2;
}

/* ============================================
   Stats Bar
   ============================================ */
.stats-bar {
    display: flex;
    background: var(--white);
    padding: 14px 16px;
    margin-bottom: 6px;
    gap: 8px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
}

.stat-item .stat-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-item .stat-label {
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 2px;
    display: block;
}

/* ============================================
   Campaign Card
   ============================================ */
.campaign-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.campaign-card:hover {
    box-shadow: var(--shadow-md);
}

.campaign-card .card-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.campaign-card .card-body {
    padding: 12px 14px;
}

.campaign-card .card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.campaign-card .card-mitra {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.campaign-card .card-mitra i {
    color: var(--primary);
    margin-right: 4px;
    font-size: 12px;
}

.progress-thin {
    height: 4px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-thin .bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.campaign-card .card-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.campaign-card .card-stats .collected label {
    font-size: 10px;
    color: var(--gray-500);
    display: block;
    margin-bottom: 1px;
}

.campaign-card .card-stats .collected span {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.campaign-card .card-stats .remaining {
    font-size: 11px;
    color: var(--gray-500);
}

/* Campaign Card Horizontal */
.campaign-card-h {
    display: flex;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}

.campaign-card-h:hover {
    box-shadow: var(--shadow-md);
}

.campaign-card-h .card-img {
    width: 110px;
    min-height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

.campaign-card-h .card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.campaign-card-h .card-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.campaign-card-h .card-mitra {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.campaign-card-h .card-stats .collected span {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.campaign-card-h .card-stats .remaining {
    font-size: 10px;
    color: var(--gray-500);
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: sticky;
    bottom: 0;
    width: 100%;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding: 6px 0 8px;
}

.bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 500;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;
}

.bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

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

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

/* ============================================
   Buttons
   ============================================ */
.btn-donate {
    background: var(--secondary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
}

.btn-donate:hover {
    background: #e55a2b;
    color: var(--white);
}

.btn-primary-yd {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}

.btn-primary-yd:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-outline-yd {
    background: var(--white);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}

.btn-outline-yd:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   Form Inputs (Clean Style)
   ============================================ */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-input:focus {
    border-color: var(--primary);
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

/* ============================================
   Nominal Selection (Donation)
   ============================================ */
.nominal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.nominal-option {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
}

.nominal-option:hover,
.nominal-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.nominal-option input {
    display: none;
}

/* ============================================
   Badge / Status
   ============================================ */
.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-paid { background: #e8f8ef; color: var(--success); }
.badge-unpaid { background: #fef6e7; color: var(--warning); }
.badge-expired { background: #fde8e8; color: var(--danger); }
.badge-pending { background: #fef6e7; color: var(--warning); }
.badge-active { background: #e8f8ef; color: var(--success); }
.badge-rejected { background: #fde8e8; color: var(--danger); }

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-200);
    margin-bottom: 12px;
}

.empty-state h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================
   Admin / Mitra Dashboard
   ============================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px;
}

.dash-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.dash-card .dash-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
}

.dash-card .dash-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.dash-card .dash-label {
    font-size: 11px;
    color: var(--gray-500);
}

/* ============================================
   Table (Admin)
   ============================================ */
.table-yd {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-yd th {
    background: var(--gray-100);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.table-yd td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--gray-700);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    padding: 30px 24px;
    background: var(--white);
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo img {
    width: 160px;
    margin-bottom: 8px;
}

.auth-logo p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

/* ============================================
   Responsive (Mobile actual device)
   ============================================ */
@media (max-width: 430px) {
    .app-container {
        box-shadow: none;
    }
}
