/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Focus indicators - very important for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Login/Signup Page */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#login-container,
#signup-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a1a;
}

h2 {
    margin-bottom: 20px;
    color: #1a1a1a;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="email"]:hover,
input[type="password"]:hover,
textarea:hover {
    border-color: #999;
}

input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: #0066cc;
}

/* Error and success states */
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #d32f2f;
}

.error {
    display: block;
    color: #d32f2f;
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}

.success {
    display: block;
    color: #2e7d32;
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}

.help-text {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Buttons */
button {
    width: 100%;
    padding: 12px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0052a3;
}

button:active {
    background-color: #004080;
}

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

/* Links */
a {
    color: #0066cc;
    text-decoration: underline;
}

a:hover {
    color: #0052a3;
}

p {
    margin-top: 20px;
    text-align: center;
}

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

/* Sidebar */
#sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#sidebar h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 20px;
}

#sidebar ul {
    list-style: none;
    flex-grow: 1;
}

#sidebar li {
    margin-bottom: 10px;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #34495e;
    color: white;
}

.nav-link.active {
    background-color: #0066cc;
    color: white;
}

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

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

/* Main Content */
#main-content {
    flex-grow: 1;
    padding: 40px;
    background-color: #f5f5f5;
}

.content-page {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.content-page h1 {
    margin-bottom: 30px;
    text-align: left;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

#announcement-status {
    margin-top: 20px;
    padding: 12px;
    border-radius: 4px;
    font-weight: 500;
}

#announcement-status.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

#announcement-status.error {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #d32f2f;
}

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

    #sidebar {
        width: 100%;
    }

    #main-content {
        padding: 20px;
    }

    .content-page {
        padding: 20px;
    }

    #login-container,
    #signup-container {
        padding: 20px;
    }
    
    .date-range-inputs {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* Loading state */
button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: "Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    width: auto;
}

.tab-button:hover {
    background: #f5f5f5;
    color: #333;
}

.tab-button.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
    background: transparent;
}

.tab-button:focus {
    outline: 3px solid #0066cc;
    outline-offset: -3px;
}

.tab-content {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.data-table thead {
    background: #f5f5f5;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table tbody tr:hover {
    background: #f9f9f9;
}

.data-table tbody tr:focus-within {
    background: #f0f7ff;
    outline: 2px solid #0066cc;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    padding: 6px 12px;
    font-size: 14px;
    width: auto;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
}

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

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

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

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

.btn-success {
    background-color: #2e7d32;
    color: white;
}

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

/* Section Cards */
.section-card {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.section-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #1a1a1a;
}

/* Balance Display */
.balance-card {
    text-align: center;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.balance-display {
    font-size: 48px;
    font-weight: bold;
    color: #2e7d32;
    margin: 20px 0;
}

.balance-display.negative {
    color: #e74c3c;
}

/* Date Range Filter */
.date-range-filter {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.date-range-filter h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.date-range-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-range-inputs .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-buttons button {
    width: auto;
    padding: 12px 20px;
}

.date-range-display {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    color: #0066cc;
    font-weight: 600;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: auto;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-actions button {
    width: auto;
    padding: 10px 20px;
}

.modal-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.modal-status.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

.modal-status.error {
    background: #ffebee;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* Loading and Empty States */
.loading-text {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 16px;
}

/* Transaction Amount Styling */
.amount-positive {
    color: #2e7d32;
    font-weight: 600;
}

.amount-negative {
    color: #e74c3c;
    font-weight: 600;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #0066cc;
    border-radius: 4px;
    font-size: 14px;
}

/* Meta Information */
.meta {
    font-size: 14px;
    color: #999;
}

/* Ensure proper spacing in forms */
.form-group + .form-group {
    margin-top: 0;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.status-draft {
    background-color: #e0e0e0;
    color: #666;
}

.status-processing {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-ready {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Audio Player */
.audio-player {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.audio-control-btn {
    width: 100%;
    padding: 12px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.audio-control-btn:hover {
    background-color: #0052a3;
}

.audio-control-btn:active {
    background-color: #004080;
}

.audio-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-progress-bar {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

.audio-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #0066cc;
    border-radius: 50%;
    cursor: pointer;
}

.audio-progress-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #0066cc;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.audio-progress-bar:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.time-display {
    font-size: 14px;
    color: #666;
    font-family: monospace;
    min-width: 45px;
    text-align: center;
}

audio {
    width: 100%;
    margin-bottom: 10px;
}

/* Reminder Indicators */
.reminder-indicator {
    display: inline-block;
    padding: 4px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.no-reminders {
    color: #999;
    font-size: 16px;
}

/* Reminder Modal */
.reminder-section {
    margin-bottom: 30px;
}

.reminder-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.reminder-add-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.reminder-add-form .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.reminder-add-form button {
    width: auto;
    padding: 12px 20px;
}

.reminders-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.reminder-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.reminder-info strong {
    font-size: 16px;
    color: #333;
}

.reminder-datetime {
    font-size: 14px;
    color: #666;
}

.reminder-sent {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.reminder-pending {
    display: inline-block;
    padding: 2px 8px;
    background: #fff3e0;
    color: #f57c00;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    width: auto;
}

/* Dropbox Browser */
.breadcrumb-nav {
    margin-bottom: 20px;
}

.breadcrumb {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 4px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: #999;
    font-size: 18px;
}

.breadcrumb-link {
    background: transparent;
    border: none;
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    font-family: inherit;
}

.breadcrumb-link:hover {
    color: #0052a3;
}

.breadcrumb-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.dropbox-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.dropbox-actions button {
    width: auto;
    padding: 10px 16px;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-box button {
    width: auto;
}

.file-browser {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.file-table {
    margin-top: 0;
}

.file-link {
    background: transparent;
    border: none;
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
}

.file-link:hover {
    color: #0052a3;
}

.file-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.file-name {
    display: inline-block;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: #0066cc;
    transition: width 0.3s ease;
}

