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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #FFFFFF !important;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1 {
    color: white;
}

main {
    flex: 1;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 25px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background-color: #2E7D32;
}

.back-btn {
    padding: 8px 15px;
    background-color: #6c757d;
    margin-bottom: 15px;
}

.back-btn:hover {
    background-color: #5a6268;
}

/* Homepage feature cards */
.feature-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 30px;
    width: 300px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: #333;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: #4CAF50;
}

.feature-card p {
    color: #000000;
}

.content-area {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 400px;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    margin: 0;
    margin-left: 20px;
    color: #4CAF50;
}

.welcome-message {
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    color: #666;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

textarea {
    min-height: 150px;
}

/* Filter container */
.filter-container {
    margin-bottom: 20px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-top: 15px;
}

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

.filter-options .btn {
    padding: 10px 15px;
}

/* Notes display */
.notes-list {
    max-height: 500px;
    overflow-y: auto;
}

.note-item {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.note-person-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 70%;
    word-break: break-word;
    min-height: 20px;
    overflow: visible;
    white-space: normal;
    line-height: 1.4;
}

.note-item .note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
    align-items: flex-start;
}

.note-person-info span {
    display: inline-block;
    min-width: 50px;
    overflow: visible;
    text-overflow: clip;
}

/* Ensure text is always visible */
.note-person-info:empty::before {
    content: "(unknown)";
    color: #999;
    font-style: italic;
}

.note-from, .note-to {
    font-weight: bold;
}

.note-from {
    color: #4CAF50;
}

.note-to {
    color: #0072B2;
}

.note-arrow {
    color: #666;
    font-size: 16px;
}

.note-time {
    color: #888;
}

.note-message {
    font-size: 16px;
    line-height: 1.5;
    color: #000000;
}

/* Tabs for Read Notes */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    color: #000000;
}

.tab.active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    color: #4CAF50;
    font-weight: bold;
}

/* Leaderboard styles */
.leaderboard-header {
    margin-bottom: 20px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.leaderboard-table th {
    background-color: #f1f1f1;
}

.leaderboard-table tr:hover {
    background-color: #f9f9f9;
}

.chart-container {
    margin-top: 30px;
    height: 400px;
    width: 100%;
    overflow-x: auto;
}

/* Static chart styles */
.static-chart {
    height: 350px;
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.chart-label {
    flex: 1;
    text-align: center;
    font-size: 14px;
    padding: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 300px;
    margin-top: 10px;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    margin: 0 10px;
}

.chart-bar.current-user {
    border: 2px solid #4a90e2;
    border-radius: 5px;
    background-color: rgba(74, 144, 226, 0.1);
}

.bar-segment {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
}

.bar-segment.sent {
    background-color: #0072B2; /* Blue */
}

.bar-segment.received {
    background-color: #4CAF50; /* Green */
}

.filter-info {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-style: italic;
    color: #666;
}

.chart-legend {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-color {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.legend-color.sent {
    background-color: #0072B2; /* Blue */
}

.legend-color.received {
    background-color: #4CAF50; /* Green */
}

/* Form header */
.form-header {
    margin-bottom: 20px;
}

/* Leaderboard specific styles */
.leaderboard-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group label {
    margin-bottom: 0;
    margin-right: 5px;
}

.filter-group select {
    width: auto;
    padding: 8px;
}

.export-btn {
    background-color: #4CAF50;
    padding: 8px 15px;
}

.export-btn:hover {
    background-color: #2E7D32;
}

.table-container {
    margin-top: 30px;
    overflow-x: auto;
}

/* Highlight current user in table */
tr.current-user {
    background-color: rgba(76, 175, 80, 0.1);
    font-weight: bold;
}

tr.current-user td {
    border-left: 3px solid #4CAF50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaderboard-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        margin-bottom: 10px;
    }
    .note-person-info {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        max-width: 100%;
        width: 100%;
    }
    
    .note-arrow {
        display: inline;
    }
    
    .note-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .note-time {
        font-size: 12px;
    }
}

/* Focus styles for better accessibility */
*:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

button:focus, a:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
}

.feature-card:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Update color for focus indicators */
:focus-visible {
    outline-color: #4CAF50;
}

h1 {
    color: white;
}

/* Override text colors to black for better visibility */
.welcome-message h2 {
    color: #000000 !important;
}

.welcome-message p {
    color: #000000 !important;
}

.feature-card p {
    color: #000000 !important;
}

#senderName {
    color: #000000 !important;
}

/* CSV Export Button Styles */
.csv-export-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    padding: 10px 0;
}

.csv-export-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csv-export-btn:hover {
    background-color: #218838;
}

.csv-export-btn:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.3);
}

.csv-export-btn::before {
    content: "📊";
    font-size: 16px;
}