/**
 * Expensify Transaction Manager Styles
 * Clean, minimal CSS without frameworks
 */

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(to bottom right, #003d20 0%, #005530 40%, #18c27c 80%, #03d47b 100%) fixed;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(to bottom right, rgba(255,255,255,0.7) 0%, rgba(224,245,236,0.7) 30%, rgba(184,232,212,0.65) 65%, rgba(142,221,184,0.6) 100%); /* AI helped me here as well */
    backdrop-filter: blur(10px); /* AI Helped me here too */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8rem;
}

/* Sections */
.section {
    margin-bottom: 30px;
}

.section h2 {
    margin: 0 0 20px 0;
    color: #34495e;
    font-size: 1.3rem;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #03d47b;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Form row for inline fields */
.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.form-row button {
    flex-shrink: 0;
}

/* Buttons */
button {
    padding: 10px 20px;
    background-color: #037144;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #00542e;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#logout-btn {
    background-color: #e74c3c;
    margin-top: 20px;
}

#logout-btn:hover {
    background-color: #c0392b;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px 0;
}

.page-btn {
    padding: 8px 16px;
    background-color: #18c27c;
    min-width: 80px;
}

.page-btn:hover:not(:disabled) {
    background-color: #005530;
}

.page-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#page-info {
    font-weight: 500;
    color: #555;
    min-width: 100px;
    text-align: center;
}

/* Messages */
.error-message {
    color: #e74c3c;
    background-color: #fdf2f2;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    border-left: 3px solid #e74c3c;
}

.success-message {
    color: #27ae60;
    background-color: #f0fdf4;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    border-left: 3px solid #27ae60;
}

.info-message {
    color: #005530;
    background-color: #f0f9ff;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border-left: 3px solid #005530;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #03d47b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Table */
#table-section {
    margin-top: 30px;
}

/* Table Controls */
.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.control-group select,
.control-group input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #fff;
}

.control-group select:focus,
.control-group input[type="text"]:focus {
    outline: none;
    border-color: #03d47b;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#search-merchant {
    min-width: 180px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

thead {
    background-color: #037144;
    color: white;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

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

tbody tr:hover {
    background-color: rgba(142,221,184,0.6);
}

/* Date column - no wrap */
td:first-child {
    white-space: nowrap;
}

/* Merchant column - wrap long text */
td:nth-child(2) {
    word-break: break-word;
    max-width: 250px;
}

/* Category column */
td:nth-child(3) {
    white-space: nowrap;
}

/* Amount column right-aligned */
th:nth-child(4),
td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
}

/* Currency column centered */
th:last-child,
td:last-child {
    text-align: center;
    white-space: nowrap;
}

/* Logout section */
#logout-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Create section */
#create-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

#create-section h2 {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        width: 100%;
    }

    .form-row button {
        width: 100%;
        margin-top: 10px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}
