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

:root {
    --bg-dark: #0f0f11;
    --bg-onyx: #18181c;
    --bg-glass: rgba(24, 24, 28, 0.85);
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #aa7c11;
    --text-white: #f5f5f7;
    --text-grey: #a0a0a5;
    --border-gold: rgba(212, 175, 55, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-gold: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 4px 15px 0 rgba(212, 175, 55, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: dark;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #242116 0%, var(--bg-dark) 60%);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--gold-light);
    font-weight: 600;
}

/* Glassmorphism Container */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-gold);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--gold-light);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), 0 4px 20px 0 rgba(212, 175, 55, 0.15);
}

/* Forms and Inputs */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: var(--gold-light);
    font-weight: 500;
}

.form-control {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

input[type="date"] {
    color-scheme: dark !important;
}

html, body, input, select, textarea {
    color-scheme: dark !important;
}

select option {
    background-color: var(--bg-onyx) !important;
    color: var(--text-white) !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.6;
    transition: var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background-color: rgba(212, 175, 55, 0.15);
}

/* Buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: 10px;
    color: #111;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 24px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    min-height: 48px;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    filter: brightness(1.1);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 10px;
    color: var(--gold-light);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 24px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 48px;
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--text-white);
}

/* Navigation & Header */
header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-logo img {
    height: 40px;
    width: auto;
}

.header-logo span {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

/* Main Layouts */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    gap: 24px;
}

/* Lists and Cards */
.list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 175, 55, 0.15);
    transform: translateX(4px);
}

/* Dialog & Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Realtime Expense Splitting UI */
.splitting-list {
    margin-top: 16px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.splitting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid var(--border-glass);
}

.splitting-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* Account Balances and Settlement Colors */
.badge-plus {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.badge-minus {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-grey);
    padding: 4px 10px;
    border-radius: 6px;
}

/* History Details Timeline */
.timeline-item {
    border-left: 3px solid var(--gold-dark);
    padding-left: 16px;
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Skeuomorphic 3D Calculator Numpad Modal Styles */
.numpad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.numpad-dialog {
    width: 360px;
    background: #000 !important;
    border: 3px solid #d4af37 !important;
    border-radius: 15px !important;
    padding: 20px !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.7) !important;
    box-sizing: border-box;
}

.numpad-display {
    width: 100%;
    height: 70px;
    box-sizing: border-box;
    margin-bottom: 20px;
    background: #111;
    color: #ffd700;
    border: 2px solid #d4af37;
    border-radius: 10px;
    text-align: right;
    padding-right: 15px;
    font-size: 36px;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
    outline: none;
}

.numpad-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.numpad-btn-3d {
    height: 65px;
    border-radius: 12px;
    border: 2px solid #d4af37;
    color: #ffd700;
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(to bottom, #555, #222);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 5px 0 #5e4700,
        0 8px 15px rgba(0, 0, 0, 0.7);
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.numpad-btn-3d:active {
    transform: translateY(4px);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 1px 0 #5e4700;
}

.numpad-btn-3d.backspace {
    background: linear-gradient(to bottom, #666, #222);
}

.numpad-btn-3d.numpad-euro {
    cursor: default;
    background: linear-gradient(to bottom, #555, #222);
}

.numpad-actions-3d {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.numpad-btn-3d.cancel {
    background: linear-gradient(to bottom, #7a2020, #300000);
}

.numpad-btn-3d.ok {
    background: linear-gradient(to bottom, #8a6b00, #3d2f00);
}

/* Custom Dropdown Styling */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-white);
    transition: var(--transition);
}

.custom-select-trigger:focus,
.custom-select-wrapper.active .custom-select-trigger {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

.custom-options-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    margin-top: 6px;
    box-shadow: var(--shadow-gold);
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-wrapper.active .custom-options-container {
    display: block;
}

.custom-option {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-white);
    font-size: 1rem;
    transition: var(--transition);
}

.custom-option:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
}

.custom-option.selected {
    background: rgba(212, 175, 55, 0.25);
    color: var(--gold-light);
    font-weight: 600;
}

/* Custom Flatpickr Overrides to match GoldDonkey */
.flatpickr-calendar {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid var(--border-gold) !important;
    box-shadow: var(--shadow-gold) !important;
    font-family: 'Inter', sans-serif !important;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover, 
.flatpickr-day.prevMonthDay.selected, 
.flatpickr-day.nextMonthDay.selected {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    color: #111 !important;
    font-weight: bold !important;
}

.flatpickr-day.today {
    border-color: var(--gold) !important;
}

.flatpickr-day.today:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--gold-light) !important;
}

.flatpickr-months .flatpickr-month {
    color: var(--gold-light) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--gold) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: var(--gold) !important;
}

.flatpickr-monthDropdown-months {
    color: var(--gold-light) !important;
    background: transparent !important;
}

span.flatpickr-weekday {
    color: var(--gold-light) !important;
    font-weight: bold !important;
}

.flatpickr-day {
    color: var(--text-white) !important;
}

.flatpickr-day:hover, .flatpickr-day:focus {
    background: rgba(212, 175, 55, 0.1) !important;
    color: var(--gold-light) !important;
}

.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
    color: rgba(255, 255, 255, 0.15) !important;
}

.flatpickr-calendar.arrowTop:after, .flatpickr-calendar.arrowTop:before {
    border-bottom-color: var(--bg-glass) !important;
}




