body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #333;
}

.filters {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 10px;
    background: #eee;
    border-radius: 8px;
}

.filters select, .filters input {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex: 1;
    min-width: 0;
}

#highlights-container,
#trending-highlights-container,
#liked-highlights-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.hero-section, .social-proof-section, .how-it-works-section {
    text-align: center;
    margin-bottom: 40px;
}

.social-proof-section h3, .how-it-works-section h3 {
    margin-bottom: 20px;
}

.steps {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.step {
    flex: 1;
    padding: 20px;
}

.step i {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #007bff;
}

.highlight {
    border-left: 5px solid;
    padding: 15px;
    background: #fafafa;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.highlight.color-0 { border-color: rgba(255, 235, 59, 1); }
.highlight.color-1 { border-color: rgba(233, 30, 99, 1); }
.highlight.color-2 { border-color: rgba(33, 150, 243, 1); }
.highlight.color-3 { border-color: rgba(76, 175, 80, 1); }

.highlight .book-title {
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-icon {
    cursor: pointer;
    margin-left: 10px;
    color: #aaa;
}

.highlight-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.like-btn .fa-heart {
    font-size: 1.2em;
}

.like-btn.liked .fa-heart {
    color: #e91e63; /* Pink color for liked */
}

.like-count {
    font-size: 1em;
    color: #777;
}

.share-icon:hover {
    color: #333;
}

.shared-by {
    font-size: 0.8em;
    color: #777;
    text-align: right;
    margin-bottom: 0px;
}

.shared-by a {
    color: #007bff;
    text-decoration: none;
}

.shared-by a:hover {
    text-decoration: underline;
}

.highlight .annotation {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    border-left: 3px solid #ccc;
    padding-left: 10px;
}

.highlight .date {
    font-size: 0.8em;
    color: #999;
    text-align: right;
}

.right-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.highlight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0px;
}

#dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}


.chart-container {
    flex: 1 1 30%;
    min-width: 30%;
    background: #fff;
    padding: 0px;
    border-radius: 0px;
    box-shadow: 0 0 5px rgba(0,0,0,0.05);
}

#time-spent-chart-container,
#books-chart-container {
    height: 400px;
    overflow-y: auto;
}

.chart-wrapper {
    position: relative;
}

.chart-container.full-width {
    flex-basis: 100%;
}

#timeline-filters {
    margin-bottom: 10px;
}

#timeline-filters button {
    padding: 5px 10px;
    margin-right: 5px;
    border: 1px solid #ddd;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
}

#timeline-filters button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

#chartjs-tooltip {
    opacity: 1;
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 3px;
    transition: opacity 0.2s;
    pointer-events: none;
    padding: 10px;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

#chartjs-tooltip table {
    margin: 0;
    padding: 0;
    border-spacing: 0;
}

#chartjs-tooltip th, #chartjs-tooltip td {
    border: 0;
    padding: 2px 5px;
}

#timeline-chart {
    height: 300px !important;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    text-align: left;
    margin-right: auto;
}

#user-profile {
    display: flex;
    align-items: center;
}

#user-profile button {
    margin-left: 10px;
    padding: 8px 12px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#user-profile button:hover {
    background-color: #0056b3;
}

#user-profile #logout-btn {
    background-color: #6c757d;
}

#user-profile #logout-btn:hover {
    background-color: #5a6268;
}

#user-profile a {
    margin-right: 15px;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

/* Profile Section */
#profile-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

#profile-view h2 {
    margin-top: 0;
}

#profile-social a {
    margin-right: 0.5rem;
    text-decoration: none;
    color: #007bff;
}

#profile-social a:hover {
    text-decoration: underline;
}

#profile-social i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid #ccc;
    margin-bottom: 1rem;
}

.tab-link {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    border-bottom: 3px solid #007bff;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.word-list {
    list-style: none;
    padding: 0;
}

.word-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

.word-text {
    font-weight: bold;
}

.book-title-word {
    font-style: italic;
    color: #555;
}

#char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
}

#edit-profile-btn, #cancel-edit-btn {
    margin-top: 1rem;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#edit-profile-btn {
    background-color: #007bff;
    color: white;
}

#edit-profile-btn:hover {
    background-color: #0056b3;
}

#cancel-edit-btn {
    background-color: #6c757d;
    color: white;
}

#cancel-edit-btn:hover {
    background-color: #5a6268;
}

#profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#profile-form label {
    font-weight: bold;
}

#profile-form input[type="text"],
#profile-form input[type="url"],
#profile-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#profile-form textarea {
    min-height: 100px;
    resize: vertical;
}

#profile-form h3 {
    margin-top: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

#profile-form button[type="submit"] {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    align-self: flex-start;
}

#profile-form button[type="submit"]:hover {
    background-color: #45a049;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#share-button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
}

#share-button:hover {
    background-color: #0056b3;
}

#share-button i {
    margin-right: 8px;
}

#landing-upload-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    margin-bottom: 20px;
}

#landing-upload-btn:hover {
    background-color: #0056b3;
}

/* Dark Mode */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .container {
    background: #1e1e1e;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 {
    color: #e0e0e0;
}

body.dark-mode .filters {
    background: #2a2a2a;
}

body.dark-mode .filters select, body.dark-mode .filters input {
    background: #333;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .highlight {
    background: #2a2a2a;
}

body.dark-mode .highlight .book-title {
    color: #e0e0e0;
}

body.dark-mode .share-icon {
    color: #ccc;
}

body.dark-mode .like-btn {
    color: #ccc;
}

body.dark-mode .like-btn.liked .fa-heart {
    color: #e91e63;
}

body.dark-mode .like-count {
    color: #aaa;
}

body.dark-mode .shared-by a {
    color: #1e90ff;
}

body.dark-mode .highlight .annotation {
    color: #bbb;
    border-left-color: #555;
}

body.dark-mode .highlight .date {
    color: #888;
}

body.dark-mode header {
    background-color: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode #user-profile a {
    color: #e0e0e0;
}

body.dark-mode .modal-content {
    background-color: #2a2a2a;
}

body.dark-mode .close-button {
    color: #ccc;
}

body.dark-mode .close-button:hover,
body.dark-mode .close-button:focus {
    color: white;
}

body.dark-mode #profile-section {
    background-color: #2a2a2a;
}

body.dark-mode #profile-social a {
    color: #1e90ff;
}

body.dark-mode .tab-link {
    color: #e0e0e0;
}

body.dark-mode .tab-link.active {
    border-bottom-color: #1e90ff;
}

body.dark-mode #profile-form input[type="text"],
body.dark-mode #profile-form input[type="url"],
body.dark-mode #profile-form textarea {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode #char-counter {
    color: #aaa;
}

body.dark-mode #profile-form button[type="submit"] {
    background-color: #006400; /* Darker Green */
}

body.dark-mode #profile-form button[type="submit"]:hover {
    background-color: #004d00;
}

body.dark-mode .chart-container {
    background: #1e1e1e;
}

body.dark-mode .upload-container {
    background: #1e1e1e;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

body.dark-mode .instructions {
    background-color: #2a2a2a;
    border-color: #444;
}

.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #333;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
}

body.dark-mode .dark-mode-toggle {
    background-color: #f4f4f4;
    color: #333;
}

/* Masonry Layout */
#highlights-container.masonry, #trending-highlights-container.masonry {
    display: block;
    column-count: 3;
}

#highlights-container.masonry .highlight, #trending-highlights-container.masonry .highlight {
    display: inline-block;
    margin-bottom: 20px;
    break-inside: avoid;
}

@media (max-width: 992px) {
    #highlights-container.masonry, #trending-highlights-container.masonry {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    #highlights-container.masonry, #trending-highlights-container.masonry {
        column-count: 1;
    }
}

#loading-indicator {
    text-align: center;
    padding: 20px;
    font-size: 1.2em;
    color: #777;
}
