/**
 * Expense Tracker - Main Stylesheet
 * 
 * This file contains all the CSS styles for the Expense Tracker application.
 * The design is clean, modern, and mobile-responsive.
 */

/* ============================================
   Global Styles & Reset
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* ============================================
   Page Header (for content pages)
   ============================================ */

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.page-header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    color: #666;
    font-size: 1.1em;
    margin-top: 10px;
}

/* ============================================
   Cards (for Dashboard Summary)
   ============================================ */

.card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.summary-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.summary-card .amount {
    font-size: 2.5em;
    font-weight: bold;
    margin-top: 10px;
}

/* ============================================
   Forms
   ============================================ */

.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: #667eea;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

/* ============================================
   Tables
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

thead {
    background: #667eea;
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Category badges */
.category-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.category-food {
    background: #ffeaa7;
    color: #d63031;
}

.category-travel {
    background: #74b9ff;
    color: #2d3436;
}

.category-shopping {
    background: #fd79a8;
    color: #2d3436;
}

.category-bills {
    background: #55efc4;
    color: #2d3436;
}

.category-entertainment {
    background: #a29bfe;
    color: white;
}

.category-healthcare {
    background: #ff7675;
    color: white;
}

.category-education {
    background: #74b9ff;
    color: white;
}

.category-insurance {
    background: #55efc4;
    color: #2d3436;
}

.category-investment {
    background: #fdcb6e;
    color: #2d3436;
}

.category-personal-care {
    background: #fd79a8;
    color: #2d3436;
}

.category-gifts-&-donations {
    background: #e17055;
    color: white;
}

.category-other {
    background: #b2bec3;
    color: #2d3436;
}

/* ============================================
   Filter Section
   ============================================ */

.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

/* ============================================
   Messages (Success/Error)
   ============================================ */

.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 1.2em;
    margin-top: 10px;
}

/* ============================================
   Landing Page Styles
   ============================================ */

.landing-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 50px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3em;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.3em;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: white;
    color: #667eea;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
}

.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 18px 50px;
    font-size: 1.2em;
}

.features-section {
    margin: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 40px;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

.how-it-works {
    margin: 60px 0;
    padding: 40px 0;
    background: #f8f9fa;
    border-radius: 15px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 0 20px;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.step h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.step p {
    color: #666;
    line-height: 1.6;
}

.cta-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin: 60px 0;
}

.cta-section h2 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 15px;
}

.cta-section p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* ============================================
   Responsive Design (Mobile)
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 15px auto;
    }

    .hero-title {
        font-size: 2em;
    }

    .hero-subtitle {
        font-size: 1.1em;
    }

    .section-title {
        font-size: 2em;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-form .form-group {
        width: 100%;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 10px;
    }

    /* Make table scrollable on mobile */
    .table-container {
        overflow-x: auto;
    }
}
