:root {
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

html {
    height: -webkit-fill-available;
}

/* Background Effects */
.bg-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, var(--primary-glow) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.2) 0%, transparent 40%);
    z-index: -1;
    filter: blur(80px);
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    z-index: -2;
}

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: -1px;
}

.logo h1 span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .icon {
    font-size: 1.8rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 300;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
    width: 100%;
}

.card-header {
    margin-bottom: 1.25rem;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Inputs & Buttons */
.input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

input[type="text"], input[type="number"] {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 0 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline {
    background: rgba(139, 92, 246, 0.05);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    border-radius: 18px;
    padding: 1rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
}

/* Tags List */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    min-height: 44px;
}

.tag {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--text-main);
    padding: 0.6rem 1.1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
}

.tag .remove {
    cursor: pointer;
    font-weight: 800;
    color: var(--secondary);
}

/* Expenses List */
.expense-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.expense-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.expense-row label {
    font-weight: 700;
}

/* Results Section */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    background: rgba(15, 23, 42, 0.6);
    padding: 1.25rem 0.75rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.summary-item .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    font-weight: 700;
}

.summary-item .value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-green);
}

.success-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.settlement-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.settlement-card .who .from {
    font-weight: 800;
    color: var(--secondary);
}

.settlement-card .amount {
    font-size: 1.25rem;
    font-weight: 800;
}

/* Animations */
.hidden { display: none !important; }

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.fade-in { animation: popIn 0.5s ease-out; }
.slide-up { animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.scale-in { animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* ========================================================================= */
/*                   FLOATING BRAND TAG NEXUSCODE                   */
/* ========================================================================= */

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

.nav-nexus-icon { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
.nav-nexus-shape { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.nav-nexus-shape-1 { border-top-color: #6366f1; border-right-color: #6366f1; animation: nexus-spin 2s linear infinite; }
.nav-nexus-shape-2 { inset: 4px; border-bottom-color: #818cf8; border-left-color: #818cf8; animation: nexus-spin-rev 1.5s linear infinite; }
.nav-nexus-shape-3 { inset: 9px; border-top-color: #a5b4fc; animation: nexus-spin 3s linear infinite; }
.nav-nexus-core { position: absolute; inset: 13px; background: #6366f1; border-radius: 50%; }

.brand-tag-vertical {
    position: fixed; left: 0; bottom: 120px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #e2e8f0; padding: 12px 6px; border-radius: 0 8px 8px 0;
    border: 1px solid rgba(99, 102, 241, 0.3); border-left: none;
    z-index: 9999; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: all 0.3s ease; text-decoration: none; cursor: pointer;
}

.brand-tag-vertical:hover { padding-left: 10px; background: #000000; }

.tag-icon-container { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-bottom: 4px; }
.tag-icon-container .nav-nexus-icon { transform: scale(0.6); }

.tag-text-vertical {
    writing-mode: vertical-rl; text-orientation: mixed;
    white-space: nowrap; font-family: 'Outfit', sans-serif; font-size: 0.55rem;
    font-weight: 700; letter-spacing: 1px; color: #94a3b8; transition: color 0.3s ease;
}

.brand-tag-vertical:hover .tag-text-vertical { color: #ffffff; }
.tag-text-vertical .highlight-brand { color: #6366f1; font-weight: 800; }
