/* Modern Money Management App - Clean & Professional Design */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1a202c;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #2d3748;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Container Layout */
.container, .main-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem;
    background: #f7fafc;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Navigation and Back Links */
.back-link {
    display: inline-flex;
    align-items: center;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.back-link:hover {
    background: #edf2f7;
    color: #2d3748;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Buttons */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
    min-width: 120px;
}

.btn-blue {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: #fff;
}

.btn-blue:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.btn-green {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #fff;
}

.btn-green:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-red {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: #fff;
}

.btn-red:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 62, 62, 0.3);
}

.btn-gray {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
}

.btn-gray:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(113, 128, 150, 0.3);
}

.btn-orange {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: #fff;
}

.btn-orange:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

/* App-specific button colors */
.btn-personal {
    background: linear-gradient(135deg, #d53f8c 0%, #b83280 100%);
    color: #fff;
}
.btn-personal:hover {
    background: linear-gradient(135deg, #b83280 0%, #97266d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 50, 128, 0.4);
}

.btn-finance {
    background: linear-gradient(135deg, #38b2ac 0%, #2c7a7b 100%);
    color: #fff;
}
.btn-finance:hover {
    background: linear-gradient(135deg, #2c7a7b 0%, #285e61 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 178, 172, 0.4);
}

.btn-bills {
    background: linear-gradient(135deg, #ecc94b 0%, #d69e2e 100%);
    color: #1a202c;
}
.btn-bills:hover {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 201, 75, 0.4);
}

.btn-calendar {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    color: #fff;
}
.btn-calendar:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #434190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Cards */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Debt Cards */
.debt-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.debt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.debt-card.owed-to-me {
    border-left: 4px solid #48bb78;
}

.debt-card.i-owe {
    border-left: 4px solid #f56565;
}

.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.debt-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.debt-amount.positive {
    color: #48bb78;
}

.debt-amount.negative {
    color: #f56565;
}

.debt-person {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.debt-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.debt-detail {
    display: flex;
    flex-direction: column;
}

.debt-detail-label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.debt-detail-value {
    font-weight: 500;
    color: #2d3748;
}

/* Payment History */
.payment-history {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f7fafc;
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-amount {
    font-weight: 600;
    color: #48bb78;
}

.payment-date {
    font-size: 0.875rem;
    color: #718096;
}

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

.summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.summary-card.positive {
    border-left: 4px solid #48bb78;
}

.summary-card.negative {
    border-left: 4px solid #f56565;
}

.summary-card.neutral {
    border-left: 4px solid #4299e1;
}

.summary-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.summary-amount.positive {
    color: #48bb78;
}

.summary-amount.negative {
    color: #f56565;
}

.summary-amount.neutral {
    color: #4299e1;
}

.summary-label {
    font-size: 1rem;
    color: #718096;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    color: #2d3748;
}

.close {
    color: #718096;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close:hover {
    color: #2d3748;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.table tr:hover {
    background: #f7fafc;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.overdue {
    background: #fed7d7;
    color: #c53030;
}

.status-badge.due-soon {
    background: #feebc8;
    color: #dd6b20;
}

.status-badge.current {
    background: #c6f6d5;
    color: #2f855a;
}

/* Calendar event colors by type */
.event-item { border: 2px solid transparent; border-radius: 10px; padding: .25rem .5rem; margin-bottom: .25rem; display:flex; justify-content:space-between; align-items:center; }
.event-personal { background: #fce7f3; color: #702459; }
.event-finance { background: #e6fffa; color: #234e52; }
.event-bill { background: #fefcbf; color: #744210; }

/* Border colors by status */
.status-border-paid { border-color: #2f855a !important; }
.status-border-part_paid { border-color: #dd6b20 !important; }
.status-border-overdue { border-color: #c53030 !important; }
.status-border-unpaid { border-color: #718096 !important; }
.status-border-due_soon { border-color: #dd6b20 !important; }

/* Responsive Design */
@media (max-width: 768px) {
    .container, .main-content {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .debt-details {
        grid-template-columns: 1fr;
    }
    
    .debt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    .btn {
        min-width: auto;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Public Profile Styles */
.public-profile {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 800px;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.profile-summary {
    font-size: 1.1rem;
    color: #718096;
}

/* Interest Calculation */
.interest-info {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid #4299e1;
}

.interest-amount {
    font-weight: 600;
    color: #4299e1;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Changelog */
.changelog {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.changelog-item {
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.changelog-date {
    font-weight: 600;
    color: #4299e1;
}

.changelog-action {
    color: #718096;
}
