/* CSS Variables */
:root {
    --primary-blue: #0077B6;
    --primary-blue-dark: #023E8A;
    --accent-orange: #F77F00;
    --accent-orange-hover: #D66D00;
    --bg-color: #F0F4F8;
    --card-bg: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    --danger: #FF4D4D;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-blue);
    top: -100px;
    left: -100px;
    animation: float 20s infinite alternate;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-orange);
    bottom: -50px;
    right: -50px;
    animation: float 25s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 60px);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo h1 {
    font-weight: 700;
    color: var(--primary-blue-dark);
    font-size: 2rem;
}

.logo-icon {
    font-size: 2rem;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Main Content Views */
.view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.4s ease-out;
}

.view.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.intro-card {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
}

.intro-card h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.intro-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Inputs */
label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-blue-dark);
}

.input-group {
    display: flex;
    gap: 10px;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--accent-orange);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: var(--accent-orange-hover);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    background: var(--primary-blue-dark);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-disabled {
    background: #CCCCCC;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-text {
    background: none;
    color: var(--text-muted);
    padding: 0;
    font-size: 0.9rem;
}

.btn-text:hover {
    color: var(--primary-blue);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    width: 100%;
    margin-top: 10px;
}

.btn-outline:hover {
    background: rgba(0, 119, 182, 0.1);
}

/* Lists */
.items-list {
    list-style: none;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.items-list li {
    background: #F8FAFC;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-blue);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.items-list li.empty-state {
    border-left: none;
    color: var(--text-muted);
    justify-content: center;
    background: transparent;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.delete-btn:hover {
    color: var(--danger);
}

.expense-item-detail {
    display: flex;
    flex-direction: column;
}

.expense-desc {
    font-weight: 500;
}

.expense-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.expense-amount {
    font-weight: 700;
    color: var(--primary-blue-dark);
}

/* Expenses View */
.form-row {
    display: flex;
    gap: 12px;
}

.form-group {
    flex: 1;
    margin-bottom: 12px;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-header h2 {
    font-size: 1.4rem;
    color: var(--text-main);
}

/* Results View */
.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-box {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-orange);
}

.settlement-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settlement-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 6px solid #4CCEAC;
    /* Success Green */
}

.settlement-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.payer,
.receiver {
    font-weight: 700;
}

.amount {
    margin-left: auto;
    background: #E6FFFA;
    color: #006D5B;
    /* Dark Green */
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 400px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .stat-box {
        padding: 10px;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}