/* style.css - Premium Mobile Responsive Styling for Kas Dunia App */

:root {
    --primary-color: #5856d6;
    --primary-gradient: linear-gradient(135deg, #5856d6, #af52de);
    --secondary-color: #5ac8fa;
    --success-color: #34c759;
    --danger-color: #ff3b30;
    --warning-color: #ff9500;
    --bg-color: #f2f2f7;
    --card-bg: #ffffff;
    --text-color: #1c1c1e;
    --text-muted: #8e8e93;
    --border-color: #e5e5ea;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 24px rgba(88, 86, 214, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding-bottom: 75px; /* space for bottom navigation */
}

/* App Shell Layout */
.app-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.app-title {
    font-size: 20px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 65px;
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    width: 25%;
    height: 100%;
    transition: color 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

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

.nav-item.active svg {
    transform: scale(1.1);
    stroke-width: 2.5;
}

/* Tabs & Transitions */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Summary Dashboard Card */
.summary-card {
    background: var(--primary-gradient);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.summary-card .label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.summary-card .saldo {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0 16px 0;
    letter-spacing: -0.5px;
}

.summary-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 16px;
}

.stat-item {
    width: 48%;
}

.stat-item .stat-val {
    font-size: 18px;
    font-weight: 700;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 16px 0;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.02);
}

/* Form Styling */
.form-group {
    margin-bottom: 16px;
}

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

.form-group label span.required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #fafafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(88, 86, 214, 0.1);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row .form-group {
    width: 100%;
}

/* Dropdown and Enum input wrapper */
.select-wrapper {
    position: relative;
}

/* Image Upload Styling */
.image-upload-wrapper {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #fafafc;
    transition: all 0.2s ease;
}

.image-upload-wrapper:hover {
    border-color: var(--primary-color);
    background-color: rgba(88, 86, 214, 0.02);
}

.upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 12px;
    border-radius: var(--radius-sm);
    display: none;
    box-shadow: var(--shadow);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #ffffff;
}

/* Transaction List Items */
.trx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    transition: background-color 0.2s;
}

.trx-item:last-child {
    border-bottom: none;
}

.trx-left {
    display: flex;
    flex-direction: column;
}

.trx-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

.trx-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.trx-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.trx-amount {
    font-size: 15px;
    font-weight: 800;
}

.trx-amount.in {
    color: var(--success-color);
}

.trx-amount.out {
    color: var(--danger-color);
}

.trx-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
    background-color: #e5e5ea;
    color: var(--text-color);
}

/* Custom badges */
.badge-in {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.badge-out {
    background-color: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-end; /* Mobile drawer style */
}

.modal-content {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 24px;
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
}

.btn-close {
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    z-index: 3000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    text-align: center;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background-color: var(--success-color);
}

.toast.error {
    background-color: var(--danger-color);
}

/* Spinner Loader */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(88, 86, 214, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Floating Master Add Action Buttons */
.master-list-group {
    margin-top: 16px;
}

.master-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.master-row:last-child {
    border-bottom: none;
}

/* Custom list layout */
.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}
.detail-item .lbl { color: var(--text-muted); }
.detail-item .val { font-weight: 600; text-align: right; }

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.action-buttons .btn {
    padding: 10px;
    font-size: 14px;
}
