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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #3498db;
}

.tab-button.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.input-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pain-scale {
    margin-bottom: 30px;
}

.pain-scale label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
}

.pain-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pain-input-container input[type="range"] {
    flex: 1;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
}

.pain-input-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

.pain-input-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.pain-value {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
    min-width: 40px;
    text-align: center;
}

.pain-scale-visual {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.scale-item {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    flex: 1;
    margin: 0 5px;
}

.scale-low {
    background-color: #2ecc71;
    color: white;
}

.scale-medium {
    background-color: #f39c12;
    color: white;
}

.scale-high {
    background-color: #e74c3c;
    color: white;
}

.comment-section {
    margin-bottom: 30px;
}

.comment-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #2c3e50;
}

.comment-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
}

.comment-section textarea:focus {
    outline: none;
    border-color: #3498db;
}

.save-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.save-button:hover {
    background-color: #2980b9;
}

.history-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.statistics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
}

.chart-container {
    margin-bottom: 30px;
    height: 300px;
    position: relative;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.no-entries {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 0;
}

.pain-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid;
    background-color: #f8f9fa;
}

.pain-entry.pain-low {
    border-left-color: #2ecc71;
}

.pain-entry.pain-medium {
    border-left-color: #f39c12;
}

.pain-entry.pain-high {
    border-left-color: #e74c3c;
}

.entry-content {
    flex: 1;
}

.entry-date {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.entry-pain-level {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.entry-comment {
    color: #666;
    font-style: italic;
}

.delete-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: #c0392b;
}

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

    h1 {
        font-size: 2em;
    }

    .input-form, .history-section {
        padding: 20px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        padding: 10px 15px;
        border-bottom: 1px solid #ddd;
    }

    .tab-button.active {
        border-bottom-color: #3498db;
    }

    .statistics {
        flex-direction: column;
        gap: 15px;
    }

    .pain-scale-visual {
        flex-direction: column;
        gap: 10px;
    }

    .scale-item {
        margin: 0;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.5em;
    }

    .pain-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .delete-button {
        align-self: flex-end;
    }
}