/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #e0e0e0;
    overscroll-behavior-y: contain; /* Prevents pull-to-refresh on the whole page body */
}

/* App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-icon {
    height: 40px;
    width: 40px;
}

.header-title {
    margin: 0;
    font-size: 1.5em;
    color: #DC143C; /* Crimson Red */
}

/* Menu Button */
#toggle-menu {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 24px;
    cursor: pointer;
}

/* Dropdown Menu */
#dropdown-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    background-color: #2c2c2c;
    width: 100%;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

#dropdown-menu.active {
    display: block;
}

#dropdown-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: none;
    background: none;
    color: #DC143C;
    cursor: pointer;
}

#dropdown-menu button:hover {
    background-color: #3c3c3c;
}

.dropdown-content {
    display: none;
}

.dropdown-content.active {
    display: block;
}

.small-menu-item {
    font-size: 0.9em;
    padding-left: 32px !important;
}

/* Main Content */
main {
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Card Styles */
.card {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    color: #DC143C;
}

/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #333;
    background-color: #2c2c2c;
    color: #e0e0e0;
}

/* Buttons */
button {
    padding: 10px 15px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background-color: #DC143C;
    color: white;
    font-size: 1em;
}

button:hover {
    opacity: 0.9;
}

.start-button {
    background-color: #28a745; /* Green */
}

.action-button {
    width: 40px;
    height: 40px;
    font-size: 1.5em;
}

.delete-btn, .delete-plan-btn, .delete-entry-btn, .delete-analyse-btn {
    background: none;
    border: none;
    color: #DC143C;
    float: right;
}

/* Lists */
#uebungsliste, #plans-list, #analyse-history-list, #plan-view-exercises, #plan-selection-list {
    list-style: none;
    padding: 0;
}

#uebungsliste li, #plans-list li, #analyse-history-list li, #plan-view-exercises li, #plan-selection-list li {
    background-color: #2c2c2c;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#plan-selection-list li:hover {
    cursor: pointer;
    background-color: #3c3c3c;
}


/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Loader */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #DC143C;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none; /* Hidden by default */
}

.loading-spinner.active {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pull to refresh indicator */
#ptr-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2em;
    color: #DC143C;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.hidden {
    display: none;
}

#plan-view-page h2, #plan-selection-page h2 {
    color: #DC143C;
}

#back-to-plans-button {
    margin-bottom: 20px;
}