/* MortMort Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Sections */
.section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Forms */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* File Upload */
.file-upload {
    margin-top: 10px;
}

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop-zone p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.file-drop-zone small {
    color: var(--secondary-color);
}

.file-list {
    margin-top: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-item .file-name {
    font-weight: 500;
}

.file-item .file-size {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-item .remove-file {
    color: var(--danger-color);
    cursor: pointer;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
    animation: progress-animation 1.5s infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    text-align: center;
    margin-top: 12px;
    color: var(--text-secondary);
}

/* Income Cards */
.income-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.card .monthly {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card .annual {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.card .expense-ratio {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card.arc {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 1px solid #93c5fd;
}

.card.arc .monthly { color: #1d4ed8; }

.card.obf {
    background: linear-gradient(135deg, #d1fae5, #ecfdf5);
    border: 1px solid #6ee7b7;
}

.card.obf .monthly { color: #059669; }

.card.deephaven {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    border: 1px solid #fcd34d;
}

.card.deephaven .monthly { color: #d97706; }

/* Summary Panel */
.summary-panel {
    display: flex;
    gap: 24px;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

.summary-item .value.disallowed {
    color: var(--danger-color);
}

.summary-item .value.eligible {
    color: var(--success-color);
}

/* NSF Alert */
.nsf-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--danger-color);
}

.nsf-alert .icon {
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Settings Panel */
.settings-panel {
    background: var(--background);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.settings-panel h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.settings-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.setting {
    flex: 1;
}

.setting label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
}

.input-group .suffix {
    padding: 10px 12px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

/* Deposits Section */
.deposits-section {
    margin-bottom: 24px;
}

.deposits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.deposits-header h3 {
    font-size: 1.1rem;
}

.deposits-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--background);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.deposits-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#deposits-table {
    width: 100%;
    border-collapse: collapse;
}

#deposits-table th,
#deposits-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#deposits-table th {
    background: var(--background);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#deposits-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

#deposits-table tbody tr:hover {
    background: var(--background);
}

#deposits-table tr.disallowed {
    background: #fef9c3;
}

#deposits-table tr.disallowed:hover {
    background: #fef08a;
}

#deposits-table .amount {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 500;
}

#deposits-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

#deposits-table .status-badge.allowed {
    background: #d1fae5;
    color: #059669;
}

#deposits-table .status-badge.disallowed {
    background: #fecaca;
    color: #dc2626;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    margin-bottom: 16px;
}

#modal-deposit-info {
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.modal-options {
    margin-bottom: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    background: var(--background);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
}

#reason-input {
    margin-bottom: 20px;
}

#reason-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .income-cards {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        flex-wrap: wrap;
    }

    .settings-row {
        flex-wrap: wrap;
    }

    .setting {
        min-width: calc(50% - 10px);
    }

    .action-buttons {
        flex-direction: column;
    }
}
