:root {
    /* Base Palette - Metallic Gold Definition */
    --gold-base: #B38728;
    --gold-highlight: #FBF5B7;
    --gold-shadow: #AA771C;
    --gold-gradient: linear-gradient(135deg, #BF953F 0%, #FCF6BA 50%, #B38728 51%, #FBF5B7 100%);
    --gold-text-shine: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #BF953F);

    /* Backgrounds */
    --black-bg: #050505;
    --black-surface: #121212;
    --black-lighter: #1e1e1e;

    /* Text */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;

    /* Mappings */
    --primary: var(--gold-base);
    /* Fallback */
    --bg-color: var(--black-bg);
    --surface-color: var(--black-surface);

    /* Effects */
    --glass-bg: rgba(20, 20, 20, 0.9);
    --gold-glow: 0 0 15px rgba(252, 246, 186, 0.2);
    --radius-lg: 24px;
    --radius-md: 16px;
    --header-height: 70px;
    --nav-height: 80px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #1a1500 0%, #050505 60%);
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Metallic Text Utilities */
.text-gold,
h1,
h2,
h3,
.amount-large {
    background: var(--gold-text-shine);
    background-size: 200% auto;
    color: #B38728;
    /* Fallback */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
    text-shadow: 0 0 0 rgba(0, 0, 0, 0);
    /* Removes webkit text shadow artifacts */
    font-weight: 700;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    letter-spacing: 0.5px;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
}

h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.w-100 {
    width: 100%;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.text-white {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none;
}

/* Layout */
#app {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(var(--nav-height) + 25px);
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

header {
    padding: 20px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* History Button styling */
.history-btn-round {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    z-index: 5;
    position: absolute;
    right: 0;
}

.history-btn-round:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

.history-link {
    background: rgba(191, 149, 63, 0.1);
    color: #BF953F;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: 0.2s;
}

.history-link:active {
    background: rgba(191, 149, 63, 0.3);
    transform: scale(0.95);
}

/* Pin Dots */
.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(191, 149, 63, 0.4);
    transition: 0.2s;
}

.pin-dot.filled {
    background: var(--gold-gradient);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(191, 149, 63, 0.5);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--black-lighter);
    border: 2px solid #BF953F;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(191, 149, 63, 0.4);
}

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(191, 149, 63, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.card-primary {
    background: linear-gradient(160deg, #1a1a1a 0%, #000 100%);
    border: 1px solid #BF953F;
}

/* Metallic Button */
.prayer-btn {
    background: var(--gold-gradient);
    color: #1a1a1a;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
    padding: 16px 30px;
    border-radius: 12px;
    border: none;
    margin-top: 20px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(179, 135, 40, 0.3);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Shine effect on button hover/active */
.prayer-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: 2;
}

.prayer-btn:active::after {
    left: 100%;
    transition: 0s;
}

.prayer-btn:active {
    transform: scale(0.98);
}

/* Inputs */
input.clean-input {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(191, 149, 63, 0.3);
    border-radius: 12px;
    background: #0a0a0a;
    color: #FBF5B7;
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: 0.3s;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

input.clean-input:focus {
    border-color: #FCF6BA;
    box-shadow: 0 0 10px rgba(252, 246, 186, 0.2);
}

/* Budget Module */
.amount-large {
    font-family: 'Playfair Display', serif;
    font-size: 52px;
    font-weight: 500;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.category-item {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 65px;
}

.category-item i {
    font-size: 18px;
    margin-bottom: 5px;
}

/* ... */

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.num-btn {
    background: var(--black-lighter);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    color: #f0f0f0;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.num-btn:active {
    background: #000;
    border-color: #BF953F;
    color: #BF953F;
}

/* Habit & Vision */
.habit-card {
    background: linear-gradient(145deg, #1c1c1c, #111);
}

.habit-card i.text-primary,
.habit-card i.fa-check-circle {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Navigation */
.bottom-nav {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(191, 149, 63, 0.2);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: 10px;
}

.nav-item {
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.nav-item.active {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: translateY(-4px);
    filter: drop-shadow(0 5px 10px rgba(191, 149, 63, 0.3));
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #0a0a0a;
    width: 100%;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-top: 1px solid #BF953F;
    padding: 30px 24px;
    color: var(--text-primary);
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.9);
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

/* FAB */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #1a1a1a;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(179, 135, 40, 0.4);
    z-index: 1500;
}

.fab:active {
    transform: scale(0.95);
}

/* Sliders */
input[type=range] {
    width: 100%;
    accent-color: #BF953F;
}

/* Action Sheet Buttons */
#sheet-actions button {
    margin-bottom: 12px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view.active {
    display: block;
}