/* Basic styles for Did I Pay It? Website */

/* General Reset & Body */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header - Reverted Padding, Added H1 Margin Reset */
header {
    background-color: #ffffff;
    padding: 1rem 2rem; /* Reverted top/bottom padding */
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Remove default margin from H1 inside header */
header h1 {
    margin: 0;
    display: flex;
    align-items: center;
}

header h1 img {
    height: 32px;
    margin-right: 10px;
}

header h1 a {
    color: #333;
    text-decoration: none;
    font-size: 1.5rem; /* Reverted font size */
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

header nav ul li {
    margin-left: 1.5rem;
}

header nav ul li a {
    text-decoration: none;
    color: #007bff;
    font-size: 1rem; /* Reverted font size */
}

header nav ul li a:hover {
    color: #0056b3;
}

/* Main Content Area */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 0.9rem;
    color: #666;
}

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

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Style for inline checkbox and label */
.form-check {
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically align items */
    margin-bottom: 1rem; /* Keep margin similar to form-group */
}

.form-check input[type="checkbox"] {
    margin-right: 0.5rem; /* Add space between checkbox and label */
    /* Remove default width if it was set by general input rules */
    width: auto;
    flex-shrink: 0; /* Prevent checkbox from shrinking */
}

.form-check label {
    /* Remove default block display if it was set by general label rules */
    display: inline;
    margin-bottom: 0; /* Remove bottom margin from label */
    font-weight: normal; /* Optional: make label less bold */
}


/* Buttons - Updated for consistency */
button[type="submit"],
.cta-button,
.button,
a.button /* Explicitly target anchor tags styled as buttons */
{
    background-color: #007bff;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center content */
    justify-content: center; /* Horizontally center content */
    text-decoration: none;
    line-height: 1; /* Adjust line height for consistency */
    box-sizing: border-box; /* Ensure padding/border are included in height */
    vertical-align: middle; /* Align buttons with surrounding text/elements */
}

button[type="submit"]:hover,
.cta-button:hover,
.button:hover,
a.button:hover {
    background-color: #0056b3;
    color: white; /* Ensure text color remains white on hover for anchors */
    text-decoration: none;
}

.delete-btn {
    background-color: #dc3545;
}

.delete-btn:hover {
    background-color: #c82333;
}

.edit-btn {
    background-color: #ffc107;
    color: #333;
}

.edit-btn:hover {
    background-color: #e0a800;
    color: #333;
}

.view-btn {
    background-color: #17a2b8;
}

.view-btn:hover {
    background-color: #138496;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle; /* Align cell content vertically */
}

table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Ensure buttons within table cells align nicely */
table td form {
    margin-bottom: 0; /* Remove extra margin for forms in table cells */
}

table td .button {
    margin-right: 0.25rem; /* Add small spacing between buttons */
    margin-bottom: 0.25rem; /* Add spacing if buttons wrap */
}

/* Flash Messages */
.flash-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.flash-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.flash-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.flash-message.info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Landing Page Specific */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #e9ecef;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: #007bff;
}

.hero-tagline {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.signup-highlight {
    background-color: #fff3cd;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.cta-button {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    margin-top: 1rem;
}

/* App Screenshots Section */
.app-screenshots {
    margin-bottom: 3rem;
    text-align: center;
}

.app-screenshots h3 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.screenshot-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.screenshot {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.screenshot-img {
    width: 100%;
    height: auto;
    display: block;
}

.screenshot-caption {
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.screenshot-caption h4 {
    margin-top: 0;
    color: #007bff;
}

/* Features Section */
.features {
    margin-bottom: 3rem;
    text-align: center;
}

.features h3 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Apply grid layout to the feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.feature-item h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #007bff;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #e9ecef;
    border-radius: 8px;
    margin-top: 3rem;
}

.cta-section h3 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* Dashboard Specific */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.summary-card h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.summary-card p {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.unknown-amount {
    font-style: italic;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem; /* Reverted mobile padding */
    }

    header nav ul {
        margin-top: 1rem; /* Reverted mobile margin */
        flex-direction: column;
    }

    header nav ul li {
        margin-left: 0;
        margin-bottom: 0.5rem; /* Reverted mobile margin */
    }

    main {
        padding: 1rem;
        margin: 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .screenshot {
        min-width: 100%;
    }

    /* Responsive Tables */
    table {
        border: 0;
    }

    table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table tr {
        border-bottom: 3px solid #ddd;
        display: block;
        margin-bottom: .625em;
    }

    table td {
        border-bottom: 1px solid #ddd;
        display: block;
        font-size: .8em;
        text-align: right; /* Align content to the right */
        padding-left: 50%; /* Make space for the label */
        position: relative;
    }

    table td::before {
        /* Use CSS content property to add labels */
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        position: absolute;
        left: 10px; /* Position label on the left */
        right: auto;
        width: 45%; /* Control label width */
        padding-right: 10px;
        white-space: nowrap;
        text-align: left; /* Align label text to the left */
    }

    /* Remove border from last cell in block */
    table td:last-child {
        border-bottom: 0;
    }

    /* Adjust button alignment in mobile tables */
    table td form,
    table td .button {
        display: inline-block; /* Allow buttons side-by-side if space */
        margin-top: 5px;
    }
}

/* History Page Summary - Side-by-side layout */
.history-summary.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Same as dashboard */
    gap: 1rem;
    margin-bottom: 2rem;
}
