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

body {
    font-family: 'Georgia', serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* File Tabs Styles */
.file-tabs-container {
    margin-bottom: 20px;
    overflow-x: auto;
}

.file-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1px;
}

.file-tab {
    padding: 10px 20px;
    background-color: #f1f3f4;
    border: 1px solid #e9ecef;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-tab:hover {
    background-color: #e2e6ea;
}

.file-tab.active {
    background-color: white;
    border-color: #007bff;
    border-bottom-color: white; /* Hide bottom border to merge with content */
    color: #007bff;
    font-weight: bold;
    margin-bottom: -2px; /* Push down to cover container border */
    z-index: 1;
}

.file-tab .close-tab {
    font-size: 1.2rem;
    line-height: 1;
    color: #adb5bd;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.file-tab .close-tab:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.date-picker {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1rem;
    font-family: 'Georgia', serif;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.date-picker:focus {
    outline: none;
    border-color: #007bff;
}

section {
    background: white;
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#entryText {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#entryText:focus {
    outline: none;
    border-color: #007bff;
}

.entry-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#saveEntry {
    background-color: #28a745;
    color: white;
}

#saveEntry:hover {
    background-color: #218838;
}

#clearEntry {
    background-color: #6c757d;
    color: white;
}

#clearEntry:hover {
    background-color: #5a6268;
}

.past-entries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.past-entries-header h2 {
    margin-bottom: 0;
}

.time-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #e9ecef;
    color: #495057;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background-color: #dee2e6;
}

.filter-btn.active {
    background-color: #007bff;
    color: white;
}

.entry-item {
    background-color: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.entry-date {
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.entry-content {
    white-space: pre-wrap;
    line-height: 1.6;
}

.similar-entry {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 0.9rem;
}

.import-export-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#importBtn, #exportBtn {
    background-color: #17a2b8;
    color: white;
}

#importBtn:hover, #exportBtn:hover {
    background-color: #138496;
}

.directory-selection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.directory-selection h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.directory-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

#selectDirectoryBtn {
    background-color: #28a745;
    color: white;
}

#selectDirectoryBtn:hover {
    background-color: #218838;
}

#loadDirectoryBtn {
    background-color: #007bff;
    color: white;
}

#loadDirectoryBtn:hover:not(:disabled) {
    background-color: #0056b3;
}

#clearDirectoryBtn {
    background-color: #dc3545;
    color: white;
}

#clearDirectoryBtn:hover:not(:disabled) {
    background-color: #c82333;
}

.directory-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.directory-info p {
    margin-bottom: 15px;
    color: #495057;
}

.file-filters {
    margin-bottom: 15px;
}

.file-filters label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.9rem;
}

.file-filters input[type="checkbox"] {
    margin-right: 8px;
}

.file-list-container {
    margin-top: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.file-list-header h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.1rem;
}

.file-selection-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

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

.file-count {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

.file-filter-input {
    margin-bottom: 10px;
}

.file-filter-input input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.file-filter-input input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    background-color: white;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item input[type="checkbox"] {
    margin-right: 10px;
}

.file-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
}

.file-path {
    font-size: 0.8rem;
    color: #6c757d;
    font-family: monospace;
}

.file-size {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 10px;
}

#loadSelectedBtn {
    background-color: #007bff;
    color: white;
}

#loadSelectedBtn:hover:not(:disabled) {
    background-color: #0056b3;
}

.no-entries {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.activity-calendar {
    overflow-x: auto;
}

.calendar-container {
    position: relative;
    min-width: 700px;
    margin-bottom: 15px;
}

.calendar-months {
    display: flex;
    margin-bottom: 5px;
    height: 20px;
    align-items: center;
}

.calendar-month {
    font-size: 11px;
    color: #666;
    flex: 1;
    text-align: left;
}

.calendar-grid {
    display: grid;
    grid-template-rows: repeat(7, 12px);
    grid-auto-flow: column;
    gap: 2px;
    grid-auto-columns: 12px;
}

.calendar-day {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(27, 31, 35, 0.06);
}

.calendar-day.level-0 {
    background-color: #ebedf0;
}

.calendar-day.level-1 {
    background-color: #9be9a8;
}

.calendar-day.level-2 {
    background-color: #40c463;
}

.calendar-day.level-3 {
    background-color: #30a14e;
}

.calendar-day.level-4 {
    background-color: #216e39;
}

.calendar-day:hover {
    border: 1px solid rgba(27, 31, 35, 0.3);
    transform: scale(1.1);
}

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 11px;
    color: #666;
}

.legend-squares {
    display: flex;
    gap: 2px;
}

.legend-square {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(27, 31, 35, 0.06);
}

.legend-square.level-0 {
    background-color: #ebedf0;
}

.legend-square.level-1 {
    background-color: #9be9a8;
}

.legend-square.level-2 {
    background-color: #40c463;
}

.legend-square.level-3 {
    background-color: #30a14e;
}

.legend-square.level-4 {
    background-color: #216e39;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    max-width: 250px;
    white-space: normal;
}

.tooltip-date {
    font-weight: bold;
    margin-bottom: 4px;
}

.tooltip-content {
    font-size: 11px;
    opacity: 0.9;
}

.year-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.year-tab {
    background-color: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.year-tab:hover {
    background-color: #dee2e6;
}

.year-tab.active {
    background-color: #007bff;
    color: white;
}

.year-tab.current-year {
    border: 2px solid #007bff;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    section {
        padding: 15px;
    }

    .time-filters {
        justify-content: center;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Mobile Sidebar for Tabs */
    .file-tabs-container {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 250px;
        background: #f8f9fa;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding: 20px;
        display: block !important; /* Force display but hidden via transform */
    }

    .file-tabs-container.open {
        transform: translateX(0);
    }

    .file-tabs {
        flex-direction: column;
        border-bottom: none;
        gap: 10px;
    }

    .file-tab {
        border-radius: 6px;
        border: 1px solid #e9ecef;
        margin-bottom: 0 !important;
    }

    .file-tab.active {
        border-bottom-color: #007bff;
    }

    /* Toggle button for mobile sidebar */
    .mobile-tab-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        background: #007bff;
        color: white;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        text-align: center;
        line-height: 50px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        cursor: pointer;
    }
}
