/* Global styles */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
    background-color: #f5f5f5;
}

body.wide {
    max-width: 800px;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    text-align: center;
    font-size: 24px;
    margin-top: 0;
}

label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

select, input[type="password"], input[type="number"], input[type="datetime-local"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    font-family: Arial, sans-serif;
}

input[type="datetime-local"] {
    -webkit-appearance: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    touch-action: manipulation;
}

button:active {
    background-color: #45a049;
}

.link {
    text-align: center;
    margin-top: 20px;
}

a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 16px;
}

a:active {
    opacity: 0.7;
}

/* Input page specific */
.weight-fields {
    display: flex;
    gap: 10px;
}

.weight-fields > div {
    flex: 1;
}

.weight-fields label {
    margin-top: 0;
}

.message {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    background-color: #d4edda;
    color: #155724;
    text-align: center;
    font-size: 16px;
}

/* View page specific */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    min-width: 500px;
}

th {
    background-color: #4CAF50;
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

tr:active {
    background-color: #f5f5f5;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 16px;
}

/* Charts page specific */
#chart {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}

/* Login page specific */
body.login-page {
    display: flex;
    align-items: center;
    min-height: 100vh;
    max-width: 400px;
}

body.login-page .container {
    padding: 30px;
}

body.login-page h1 {
    margin-bottom: 20px;
}

body.login-page label:first-of-type {
    margin-top: 0;
}

input[type="password"] {
    margin-bottom: 15px;
}

.remember {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.remember label {
    margin: 0;
    font-weight: normal;
    font-size: 14px;
}

.error {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    background-color: #f8d7da;
    color: #721c24;
    text-align: center;
    font-size: 14px;
}

/* Responsive styles */
@media (min-width: 768px) {
    body {
        margin-top: 50px;
        padding: 20px;
    }
    
    .container {
        padding: 30px;
    }
    
    th, td {
        padding: 12px 10px;
        font-size: 15px;
    }
    
    table {
        min-width: auto;
    }
    
    #chart {
        height: 500px;
    }
}

/* Notes page specific */
hr {
    margin: 30px 0 20px 0;
    border: none;
    border-top: 1px solid #ddd;
}

h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
}

.filter-form {
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 10px;
}

.filter-row > div {
    flex: 1;
}

.filter-row label {
    margin-top: 0;
}

.notes-list {
    margin-top: 15px;
}

.note-item {
    background-color: #f9f9f9;
    border-left: 4px solid #4CAF50;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.note-item.stress {
    border-left-color: #FF6B6B;
}

.note-item.gladys {
    border-left-color: #F4D03F;
}

.note-item.nora {
    border-left-color: #5DADE2;
}

.note-item.both {
    border-left-color: #58D68D;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 5px;
}

.note-header strong {
    color: #4CAF50;
    font-size: 16px;
}

.note-item.stress .note-header strong {
    color: #FF6B6B;
}

.note-item.gladys .note-header strong {
    color: #D4AC0D;
}

.note-item.nora .note-header strong {
    color: #2E86C1;
}

.note-item.both .note-header strong {
    color: #28B463;
}

.note-date {
    color: #777;
    font-size: 13px;
}

.note-text {
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
    }

    .container {
        background-color: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    h1, h2 {
        color: #e0e0e0;
    }

    label {
        color: #b0b0b0;
    }

    select, input[type="password"], input[type="number"], input[type="datetime-local"], textarea {
        background-color: #3d3d3d;
        border-color: #555;
        color: #e0e0e0;
    }

    hr {
        border-top-color: #555;
    }

    td {
        border-bottom-color: #555;
        color: #e0e0e0;
    }

    .note-item {
        background-color: #3d3d3d;
    }

    .note-text {
        color: #e0e0e0;
    }

    .note-date {
        color: #999;
    }

    .no-data {
        color: #999;
    }

    .message {
        background-color: #1e4620;
        color: #a3d9a5;
    }

    .error {
        background-color: #4a1c1c;
        color: #f5a5a5;
    }

    a {
        color: #6fcf6f;
    }
}