/* RunHub - Professional Financial Management System */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

/* Remove focus outline from non-interactive elements */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
p:focus, span:focus, div:not([tabindex]):focus {
    outline: none;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    outline: none;
}

.sidebar-header h1:focus {
    outline: none;
}

.sidebar-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    outline: none;
}

.sidebar-header p:focus {
    outline: none;
}

.nav-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-menu ul {
    list-style: none;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Page Header */
.page-header {
    margin-bottom: 0.75rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Card */
.card {
    background-color: var(--surface-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 0.75rem;
}

.card-compact {
    margin-bottom: 0.5rem;
}

.card-compact .card-body {
    padding: 0.5rem 0.75rem;
}

/* Balance Formatting */
.balance-positive {
    color: var(--success-color);
    font-weight: 600;
}

.balance-negative {
    color: var(--danger-color);
    font-weight: 600;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table thead {
    background-color: var(--background-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.data-table tbody tr:hover {
    background-color: var(--background-color);
}

.data-table td {
    padding: 0.4rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.3;
}

.data-table td small {
    font-size: 0.75rem;
}

.data-table td.amount {
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table td.positive {
    color: var(--success-color);
}

.data-table td.negative {
    color: var(--danger-color);
}

.data-table td.date {
    color: var(--text-secondary);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 0.4rem 0.5rem;
}

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

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

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

.btn-secondary:hover {
    background-color: #475569;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--danger-color);
    display: flex;
    align-items: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

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

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        padding: 1rem;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: space-between;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 1rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 1rem;
}

/* Form validation styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--danger-color);
}

.validation-message {
    color: var(--danger-color);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Balance Chart */
.balance-chart {
    height: 300px;
    margin: 0.5rem 0;
}

.balance-chart canvas {
    max-height: 300px;
}

/* Forecast Chart - Larger */
.forecast-chart {
    height: 300px;
    margin: 0.5rem 0;
}

.forecast-chart canvas {
    max-height: 300px;
}

/* Balance Boxes */
.balance-boxes {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.balance-box {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.balance-box-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
}

.balance-box-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Matched Row */
.matched-row {
    opacity: 0.6;
    font-style: italic;
}

/* Overdue Row */
.overdue-row {
    background-color: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--danger-color);
}

/* Filter Panel */
.filter-panel {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 0;
}

.filter-panel.expanded {
    max-height: 500px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
}

.filter-item label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: var(--surface-color);
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: var(--surface-color);
    transition: border-color 0.2s;
}

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

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Currency Input with Prefix */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

.form-control-with-prefix {
    padding-left: 2rem;
}

/* Inline Currency Input with Prefix */
.input-with-prefix-inline {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-prefix-inline {
    position: absolute;
    left: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
    font-size: 0.875rem;
}

.input-with-prefix-inline .inline-edit-amount {
    padding-left: 1.5rem;
}

/* Inline Edit Inputs */
.inline-edit-date,
.inline-edit-amount {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    background-color: var(--surface-color);
    transition: all 0.2s;
}

.inline-edit-date:focus,
.inline-edit-amount:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.inline-edit-date:hover,
.inline-edit-amount:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
}

.inline-edit-amount {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 130px;
}

.inline-edit-amount.positive {
    color: var(--success-color);
}

.inline-edit-amount.negative {
    color: var(--danger-color);
}

/* Amount Input Sizing */
.amount-input {
    width: 100%;
    min-width: 180px;
    font-variant-numeric: tabular-nums;
}

/* Compact Select */
.compact-select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: var(--surface-color);
    max-width: 100%;
}

.compact-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-spacer {
    flex: 1;
}

/* Icon Helpers */
.empty-state-icon i {
    font-size: 3rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.btn i {
    margin-right: 0.25rem;
}

.error-message i {
    margin-right: 0.5rem;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1.125rem;
    width: 1.25rem;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.2);
}

#backToTop:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-dialog {
    background-color: var(--surface-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Extra Small Buttons */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

/* Salary Calculator Specific Styles */
.salary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.salary-table thead {
    background-color: var(--background-color);
    border-bottom: 2px solid var(--border-color);
}

.salary-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.salary-table th:first-child {
    text-align: left;
}

.salary-table th:not(:first-child) {
    text-align: right;
}

.salary-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.salary-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.02);
}

.salary-table tbody tr.summary-row {
    background-color: var(--background-color);
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

.salary-table tbody tr.summary-row.highlight {
    background-color: rgba(37, 99, 235, 0.1);
    border-top: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.salary-table td {
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
}

.salary-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.salary-table .amount {
    font-weight: 600;
}

.salary-table .amount.positive {
    color: var(--success-color);
}

.salary-table .amount.negative {
    color: var(--danger-color);
}

.salary-input {
    width: 100%;
    max-width: 120px;
    min-width: 90px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    background-color: var(--surface-color);
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: all 0.2s;
}

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

.salary-input:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
}

.input-with-prefix-inline {
    display: inline-flex;
    align-items: center;
    max-width: 120px;
}

/* Action Buttons - Improved Design */
.action-buttons {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    justify-content: flex-start;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    padding: 0;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn-edit {
    color: var(--primary-color);
    border-color: rgba(37, 99, 235, 0.2);
}

.action-btn-edit:hover {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.action-btn-skip {
    color: var(--warning-color);
    border-color: rgba(245, 158, 11, 0.2);
}

.action-btn-skip:hover {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: #d97706;
}

.action-btn-match {
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.2);
}

.action-btn-match:hover {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: #059669;
}

.action-btn-delete {
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: #dc2626;
}

/* Hover tooltips are handled by title attribute */
.action-btn[title] {
    position: relative;
}

@media (max-width: 768px) {
    .action-buttons {
        gap: 0.25rem;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }
}

/* Database Selection Page */
.database-selection-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.database-selection-card {
    background-color: var(--surface-color);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    overflow: hidden;
}

.database-selection-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.database-selection-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    margin-bottom: 0.5rem;
}

.database-selection-header p {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.9;
}

.database-list-container {
    padding: 2rem;
}

.database-list-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.database-list-container .subtitle {
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
}

.database-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.database-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.database-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
    box-shadow: var(--shadow-sm);
}

.database-info {
    flex: 1;
}

.database-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.database-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.database-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .database-selection-container {
        padding: 1rem;
    }

    .database-selection-header h1 {
        font-size: 2rem;
    }

    .database-list-container {
        padding: 1.5rem;
    }

    .database-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .database-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 0;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: white;
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: white;
    bottom: -200px;
    right: -200px;
    animation-delay: 5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: white;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-30px) translateX(30px);
    }
    50% {
        transform: translateY(20px) translateX(-20px);
    }
    75% {
        transform: translateY(-20px) translateX(20px);
    }
}

.login-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
}

.login-card {
    background-color: var(--surface-color);
    border-radius: 1.5rem;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.login-logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-tagline {
    font-size: 1.125rem;
    margin: 1rem 0 0 0;
    opacity: 0.95;
    font-weight: 300;
}

.login-body {
    padding: 2.5rem 2rem;
}

.welcome-message {
    text-align: center;
    padding: 1rem 0;
}

.welcome-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.welcome-message h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.welcome-message p {
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    font-size: 1rem;
}

.login-info h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.login-info > p {
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    font-size: 1rem;
    line-height: 1.6;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.feature-text h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.feature-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.login-action {
    text-align: center;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.75rem;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.btn-lg:active {
    transform: translateY(-1px);
}

.btn-lg i {
    font-size: 1.25rem;
}

.login-hint {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-decoration {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideInRight 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.decoration-card {
    text-align: center;
    color: white;
}

.decoration-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin: 0 auto 2rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.decoration-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.decoration-card p {
    font-size: 1.125rem;
    line-height: 1.8;
    opacity: 0.95;
    margin: 0;
}

/* Responsive Login */
@media (max-width: 1024px) {
    .login-content {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .login-decoration {
        display: none;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }

    .login-header {
        padding: 2rem 1.5rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .login-logo h1 {
        font-size: 2rem;
    }

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

    .login-body {
        padding: 2rem 1.5rem;
    }

    .login-info h2 {
        font-size: 1.5rem;
    }

    .feature-list {
        gap: 1.25rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .btn-lg {
        width: 100%;
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    font-weight: 500;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-greeting {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signout-form {
    margin-bottom: 0.5rem;
}

.btn-signout,
.btn-signin {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-signout:hover,
.btn-signin:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-signin:hover {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.login-display {
    padding: 0.75rem 0 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}




