* {
    box-sizing: border-box;
}

:root {
    --themecolor: white;
    --txtcolor: black;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--themecolor);
    color: var(--txtcolor);
}

a{
    text-decoration: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 2em;
}

h1 {
    font-size: 24px;
    margin: 1.5em 0;
    text-align: center;
}

h1 .intro{
    font-size: 0.5em;
    margin: 0;
    font-weight: 200;
}

h2 {
    font-size: 18px;
    margin: 1.5em 0;
}

.input-section {
    display: flex;
    gap: 10px;
}

.input-group,
.button-group {
    display: flex;
    gap: 10px;
}

input {
    background: transparent;
    border: 1px solid;
    color: var(--txtcolor);
    padding: 8px 12px;
    font-size: 14px;
    flex: 1;
    outline: none;
    min-width: 120px;
}

input:focus {
    border-color: var(--txtcolor);
}

button,.button {
    background: transparent;
    border: 1px solid;
    color: var(--txtcolor);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
    white-space: nowrap;
    flex: 1;
}

button:hover,button.hover,.button:hover,.button.hover {
    color: var(--themecolor);
    background: var(--txtcolor);
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-name-duration {
    font-size: 14px;
    font-weight: 500;
}

.event-datetime {
    font-size: 12px;
    opacity: 0.7;
    color: #888;
}

.event-actions {
    display: flex;
    gap: 8px;
}

.event-actions button {
    padding: 6px 12px;
    border: 1px solid;
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.2s;
}

.event-actions button:hover {
    border-color: var(--txtcolor);
}

.stats-section {
    margin: 1em 0;
}

.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

.pie-chart {
    width: 300px;
    height: 300px;
    background: conic-gradient(var(--pie-colors));
    position: relative;
    border-radius: 50%;
}

.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--themecolor);
    width: 4em;
    height: 4em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 16px;
    height: 16px;
}

.legend-info {
    display: flex;
    justify-content: space-between;
    flex: 1;
}

.legend-name {
    color: var(--txtcolor);
}

.legend-percent {
    color: #ccc;
    font-weight: bold;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--themecolor);
    border: 1px solid;
    padding: 20px;
    max-width: 90%;
    width: 400px;
    max-height: 80%;
    overflow-y: auto;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    text-align: center;
}

.modal-buttons {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-buttons button {
    padding: 10px;
    font-size: 14px;
    min-height: 44px;
}

.modal-actions {
    display: flex;
    justify-content: center;
}

.modal-actions button {
    min-width: 120px;
}

#textImportModal textarea {
    width: 100%;
    min-height: 200px;
    background: transparent;
    border: 1px solid;
    color: var(--txtcolor);
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    margin-bottom: 15px;
    font-family: inherit;
}

#textImportModal textarea:focus {
    border-color: var(--txtcolor);
}

#textImportModal .modal-actions {
    gap: 10px;
}

#textImportModal .modal-actions button {
    min-width: 100px;
}

.stat-tabs {
    display: flex;
    gap: 5px;
}

.stat-tab {
    border: none;
    border-bottom: 1px solid var(--txtcolor);
    padding: 0 4px;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s;
    opacity: 0.25;
}

.stat-tab.active {
    opacity: 1;
}

.empty-state {
    text-align: center;
    color: var(--txtcolor);
    font-size: 14px;
    padding: 40px 0;
}

.file-input {
    display: none;
}


@media (max-width: 640px) {
    .container {
        padding: 0 2em;
    }

    .input-section,
    .pie-chart-container {
        flex-direction: column;
    }

    .pie-legend {
        max-width: 100%;
        width: 300px;
    }

    .event-actions {
        flex-direction: column;
        gap: 5px;
    }

    .event-actions button {
        width: 100%;
    }

    .data-section .button-group {
        flex-direction: column;
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-top: 15px;
}

.calendar-nav {
    font-size: 1.5em;
    border: none;
    padding: 0;
    color: var(--txtcolor)!important;
    background: none!important;
}

#currentMonthYear {
    margin: 0;
    font-size: 18px;
    color: var(--txtcolor);
}

#calendarDays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: 15px 0;
    border-top: 1px solid;
    border-bottom: 1px solid;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
    color: var(--txtcolor);
}

.calendar-day:hover {
    background-color: transparent;
    border-color: var(--txtcolor);
}

.calendar-day.has-data {
    color: var(--themecolor);
    background: var(--txtcolor);
}

.calendar-day.other-month {
    opacity: 0.25;
}

.calendar-day.selected {
    background-color: var(--txtcolor);
    color: var(--themecolor);
    border-color: var(--txtcolor);
}

.calendar-day.selected::after {
    background-color: var(--themecolor);
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    color: #666;
    padding: 5px 0;
    font-weight: 500;
}

.selected-date-info {
    background-color: transparent;
    min-height: auto;
}

.selected-date-info h4 {
    margin: 1em 0;
    color: var(--txtcolor);
    font-size: 16px;
}

.selected-date-info .empty {
    color: #888;
    font-size: 14px;
}

.selected-date-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.selected-date-info li {
    padding: 5px 0;
    font-size: 14px;
    color: var(--txtcolor);
    border-bottom: 1px dashed;
}

.selected-date-info .event-name {
    font-weight: 500;
    color: var(--txtcolor);
}

.selected-date-info .event-duration {
    opacity: 0.5;
}

.footer {
    text-align: center;
    margin: 20px 0;
    padding: 5px 0;
    font-size: 14px;
    border-top: 1px solid;
    border-bottom: 1px solid;
}

.theme-selector {
    display: inline-flex;
    gap: 8px;
    vertical-align: middle;
}

.theme-square {
    width: 20px;
    height: 20px;
    border: 1px solid var(--txtcolor);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.documentation {
    margin: 2em 0;
}

.documentation h2 {
    font-size: 24px;

    margin: 1.5em 0;
    text-align: center;
}

.documentation h3 {
    font-size: 18px;
    margin: 1em 0;
    border-left: 4px solid;
    padding-left: 0.5em;
}

.documentation p {
    margin: 0.5em 0;
    line-height: 1.6;
}

.documentation ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.documentation li {
    margin: 0.5em 0;
}

.documentation strong {
    font-weight: 500;
}

.theme-square:hover {
    transform: scale(1.1);
}