/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #EDEEF7 0%, #E4FBFF 100%);
    min-height: 100vh;
    position: relative;
}

/* Paper Texture Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 104, 230, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(184, 181, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 180, 180, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(120, 104, 230, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    text-align: center;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #7868E6;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.baby-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.app-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(120, 104, 230, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(184, 181, 255, 0.2);
    color: #7868E6;
}

.tab-btn.active {
    background: #7868E6;
    color: white;
    box-shadow: 0 4px 15px rgba(120, 104, 230, 0.3);
}

.tab-icon {
    font-size: 1.2rem;
}

/* Tab Content */
.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(120, 104, 230, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
}

.tab-content.active {
    display: block;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2rem;
    color: #7868E6;
    margin-bottom: 10px;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Form Styles */
.expense-form,
.budget-form {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-group input,
.form-group select {
    padding: 15px;
    border: 2px solid #EDEEF7;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #7868E6;
    box-shadow: 0 0 0 3px rgba(120, 104, 230, 0.1);
}

/* Category Selector */
.category-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #EDEEF7;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.category-option:hover {
    border-color: #B8B5FF;
    background: rgba(184, 181, 255, 0.1);
}

.category-option.selected {
    border-color: #7868E6;
    background: rgba(120, 104, 230, 0.1);
    color: #7868E6;
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.category-name {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Button Styles */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #7868E6;
    color: white;
    box-shadow: 0 4px 15px rgba(120, 104, 230, 0.3);
}

.btn-primary:hover {
    background: #6854d1;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(120, 104, 230, 0.4);
}

.btn-secondary {
    background: #B8B5FF;
    color: #333;
}

.btn-secondary:hover {
    background: #a8a3ff;
    transform: translateY(-2px);
}

.btn-danger {
    background: #FFB4B4;
    color: #333;
}

.btn-danger:hover {
    background: #ff9999;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Expenses List */
.expenses-list {
    display: grid;
    gap: 15px;
}

.expense-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(184, 181, 255, 0.2);
    transition: all 0.3s ease;
    gap: 15px;
}

.expense-item:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(120, 104, 230, 0.1);
}

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

.expense-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.expense-details {
    flex: 1;
}

.expense-description {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.expense-meta {
    font-size: 0.9rem;
    color: #666;
}

.expense-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(184, 181, 255, 0.2);
}

.expense-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #7868E6;
}

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

.btn-small {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    display: flex;
    align-items: center;
    padding: 25px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(184, 181, 255, 0.2);
    transition: all 0.3s ease;
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(120, 104, 230, 0.1);
}

.summary-card .card-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    width: 60px;
    text-align: center;
}

.summary-card .card-content h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #7868E6;
}

/* Chart Container */
.chart-container {
    margin-bottom: 40px;
}

.chart-container h3 {
    color: #7868E6;
    margin-bottom: 20px;
    text-align: center;
}

.chart {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 30px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(184, 181, 255, 0.2);
}

.pie-chart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.pie-visual {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-label {
    flex: 1;
    font-weight: 600;
}

.legend-value {
    font-weight: 700;
    color: #7868E6;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-bar {
    height: 20px;
    background: rgba(184, 181, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7868E6, #B8B5FF);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-percentage {
    text-align: center;
    font-weight: 700;
    color: #7868E6;
}

/* Budget Status */
.budget-status {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 30px;
}

.budget-status.on-track {
    background: rgba(144, 238, 144, 0.2);
    color: #228B22;
    border: 1px solid rgba(144, 238, 144, 0.5);
}

.budget-status.warning {
    background: rgba(255, 165, 0, 0.2);
    color: #FF8C00;
    border: 1px solid rgba(255, 165, 0, 0.5);
}

.budget-status.over-budget {
    background: rgba(255, 180, 180, 0.2);
    color: #DC143C;
    border: 1px solid rgba(255, 180, 180, 0.5);
}

/* Tips List */
.tips-list {
    display: grid;
    gap: 15px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(184, 181, 255, 0.2);
}

.tip-icon {
    font-size: 1.5rem;
    margin-top: 2px;
}

.tip-item p {
    flex: 1;
    color: #333;
    line-height: 1.6;
}

/* Reset Section */
.reset-section {
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 180, 180, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 180, 180, 0.3);
    text-align: center;
}

.reset-section h3 {
    color: #DC143C;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.reset-warning {
    color: #DC143C;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 180, 180, 0.2);
    border-radius: 10px;
    line-height: 1.6;
}

.btn-reset {
    min-width: 200px;
    font-size: 1rem;
    padding: 15px 30px;
}

.btn-reset:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

/* Report Controls */
.report-controls {
    margin-bottom: 30px;
}

.report-controls .form-group {
    max-width: 300px;
    margin: 0 auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #7868E6;
}

.empty-state p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 120px;
}

.footer p {
    color: #666;
    font-size: 0.9rem;
}

/* Bottom Navigation for Mobile */
.bottom-nav {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
        padding-bottom: 90px; /* Space for bottom nav */
    }
    
    .header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .app-title {
        font-size: 1.8rem;
        flex-direction: row;
        gap: 10px;
    }
    
    .baby-icon {
        display: inline-flex;
    }
    
    .logo-img {
        width: 50px;
        height: 50px;
    }
    
    .app-subtitle {
        font-size: 0.95rem;
    }
    
    /* Hide desktop navigation on mobile */
    .tab-navigation {
        display: none;
    }
    
    /* Show bottom navigation on mobile */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(120, 104, 230, 0.2);
        box-shadow: 0 -4px 20px rgba(120, 104, 230, 0.15);
        padding: 10px 0 max(10px, env(safe-area-inset-bottom));
        z-index: 1000;
        justify-content: space-around;
        gap: 5px;
        margin-bottom: 60px;
    }
    
    .bottom-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 10px;
        border: none;
        background: transparent;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        color: #666;
        font-size: 0.75rem;
        font-weight: 600;
        text-align: center;
        max-width: 120px;
    }
    
    .bottom-nav-btn:active {
        transform: scale(0.95);
    }
    
    .bottom-nav-btn .tab-icon {
        font-size: 1.5rem;
        transition: all 0.3s ease;
    }
    
    .bottom-nav-btn.active {
        color: #7868E6;
        background: rgba(120, 104, 230, 0.1);
    }
    
    .bottom-nav-btn.active .tab-icon {
        transform: scale(1.15);
    }
    
    .tab-content {
        padding: 20px 15px;
        margin-bottom: 0;
    }
    
    /* Compact categories for mobile */
    .category-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .category-option {
        padding: 10px 8px;
        border-radius: 12px;
    }
    
    .category-icon {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .category-name {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    /* Compact expense items for mobile */
    .recent-expenses h3,
    .expenses-history h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .expense-item {
        padding: 15px;
        border-radius: 12px;
        gap: 12px;
    }
    
    .expense-header {
        gap: 12px;
    }
    
    .expense-icon {
        font-size: 1.5rem;
        width: 40px;
    }
    
    .expense-description {
        font-size: 0.95rem;
        margin-bottom: 3px;
    }
    
    .expense-meta {
        font-size: 0.8rem;
    }
    
    .expense-footer {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 8px;
    }
    
    .expense-amount {
        font-size: 1.1rem;
    }
    
    .expense-actions {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    
    .btn-small {
        padding: 8px 12px;
        font-size: 0.75rem;
        flex: 1;
        min-width: 80px;
    }
    
    /* Compact summary cards */
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    .summary-card .card-icon {
        font-size: 2rem;
        margin-right: 15px;
        width: 50px;
    }
    
    .summary-card .card-content h4 {
        font-size: 0.8rem;
    }
    
    .summary-card .card-value {
        font-size: 1.2rem;
    }
    
    /* Compact forms */
    .form-group {
        gap: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.95rem;
    }
    
    .pie-chart {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pie-visual {
        width: 200px;
        height: 200px;
    }
    
    .footer {
        margin-bottom: 80px;
        padding: 15px;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
    
    /* Reset section mobile */
    .reset-section {
        margin-top: 30px;
        padding: 20px;
    }
    
    .reset-section h3 {
        font-size: 1.1rem;
    }
    
    .reset-warning {
        font-size: 0.9rem;
        padding: 12px;
    }
    
    .btn-reset {
        min-width: auto;
        width: 100%;
        font-size: 0.9rem;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
        padding-bottom: 90px;
    }
    
    .header {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .baby-icon {
        display: inline-flex;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .app-subtitle {
        font-size: 0.85rem;
    }
    
    .tab-content {
        padding: 15px 10px;
    }
    
    .section-header {
        margin-bottom: 20px;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .section-header p {
        font-size: 0.85rem;
    }
    
    .category-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .category-option {
        padding: 8px 5px;
    }
    
    .category-icon {
        font-size: 1.2rem;
    }
    
    .category-name {
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 12px 18px;
        font-size: 0.85rem;
    }
    
    .expense-item {
        padding: 12px;
        gap: 10px;
    }
    
    .expense-header {
        gap: 10px;
    }
    
    .expense-icon {
        font-size: 1.3rem;
        width: 35px;
    }
    
    .expense-description {
        font-size: 0.9rem;
    }
    
    .expense-meta {
        font-size: 0.75rem;
    }
    
    .expense-footer {
        gap: 8px;
        padding-top: 6px;
    }
    
    .expense-amount {
        font-size: 1rem;
    }
    
    .expense-actions {
        gap: 5px;
    }
    
    .btn-small {
        padding: 7px 10px;
        font-size: 0.7rem;
    }
    
    .summary-card {
        padding: 12px;
    }
    
    .summary-card .card-icon {
        font-size: 1.8rem;
        width: 45px;
        margin-right: 12px;
    }
    
    .summary-card .card-content h4 {
        font-size: 0.75rem;
    }
    
    .summary-card .card-value {
        font-size: 1.1rem;
    }
    
    .chart {
        padding: 15px;
        min-height: 250px;
    }
    
    .pie-visual {
        width: 180px;
        height: 180px;
    }
    
    .recent-expenses h3,
    .expenses-history h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .bottom-nav {
        padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    }
    
    .bottom-nav-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
    
    .bottom-nav-btn .tab-icon {
        font-size: 1.3rem;
    }
    
    .footer {
        padding: 12px;
    }
    
    /* Reset section mobile small */
    .reset-section {
        margin-top: 25px;
        padding: 15px;
    }
    
    .reset-section h3 {
        font-size: 1rem;
    }
    
    .reset-warning {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .btn-reset {
        font-size: 0.85rem;
        padding: 10px 18px;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #7868E6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
.tab-btn:focus,
.btn:focus,
.category-option:focus,
input:focus,
select:focus {
    outline: 2px solid #7868E6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tab-btn.active {
        background: #000;
        color: #fff;
    }
    
    .btn-primary {
        background: #000;
        color: #fff;
    }
    
    .expense-amount,
    .card-value {
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .baby-icon {
        animation: none;
    }
}
