:root {
    --primary-color: #6C63FF;
    --primary-dark: #5a52d5;
    --secondary-color: #FF6584;
    --accent-color: #43D9AD;
    --background-color: #F0F2F5;
    --card-bg: #FFFFFF;
    --text-main: #2D3436;
    --text-secondary: #636E72;
    --border-radius: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 600px;
    /* Mobile-first approach, limited width for better UX on desktop */
    background: transparent;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 10px 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    color: var(--primary-color);
}

.btn-small {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-width {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.total-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.total-card h3 {
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.total-card .amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.child-card {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.child-card:hover {
    border-color: var(--primary-color);
}

.child-card h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.child-card .child-amount {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

/* Recent Expenses */
.recent-expenses h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.expense-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.expense-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.expense-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-icon {
    width: 40px;
    height: 40px;
    background-color: #F0F2F5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.expense-details h4 {
    font-size: 1rem;
    font-weight: 600;
}

.expense-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.expense-amount {
    font-weight: 700;
    color: var(--secondary-color);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    background: white;
    border-radius: var(--border-radius);
    border: 2px dashed #e0e0e0;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Bottom sheet on mobile */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    padding: 25px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
    .modal {
        align-items: center;
    }

    .modal-content {
        border-radius: 24px;
        width: 90%;
        transform: translateY(20px);
        opacity: 0;
    }

    .modal.active .modal-content {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.close-modal {
    background: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Children List in Modal */
.add-child-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-child-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
}

.children-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.children-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #F8F9FA;
    border-radius: 10px;
}

.delete-child-btn {
    color: #FF6584;
    background: none;
    padding: 5px;
}

.hidden {
    display: none;
    /* Fallback */
}

/* Utility to override display:none for animation logic */
.modal {
    display: flex;
}

/* Delete Transaction Button Style */
.delete-btn {
    background: none;
    border: none;
    color: #dfe6e9;
    /* Silik gri */
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.3s;
}

.delete-btn:hover {
    color: #ff7675;
    /* Üzerine gelince kırmızı */
}

/* Auth Styles */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    width: 100%;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.hidden {
    display: none !important;
}