* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hiragino Kaku Gothic Pro', 'メイリオ', sans-serif;
}

body {
    background-color: #f5f9ff;
    color: #333;
}

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

h1 {
    text-align: center;
    color: #4a6fb5;
    margin-bottom: 15px;
    font-size: 2rem;
}

.description {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

.upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.custom-file-upload,
#camera-button,
#sample-button {
    padding: 12px 24px;
    background-color: #6a8fd1;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.custom-file-upload:hover,
#camera-button:hover,
#sample-button:hover {
    background-color: #4a6fb5;
}

#file-upload {
    display: none;
}

#camera-button {
    padding: 12px 24px;
    background-color: #6a8fd1;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#camera-button:hover {
    background-color: #4a6fb5;
}

.or-text {
    color: #888;
    margin: 5px 0;
}

.hidden {
    display: none !important;
}

#preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.image-container {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#preview-image {
    width: 100%;
    height: auto;
    display: block;
}

.result-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #4a6fb5;
    margin-bottom: 15px;
    text-align: center;
}

.ph-meter {
    margin: 20px 0;
}

.ph-scale {
    height: 30px;
    background: linear-gradient(to right, #e74c3c, #f1c40f, #3498db);
    border-radius: 15px;
    position: relative;
    margin-bottom: 10px;
}

.ph-marker {
    position: absolute;
    width: 10px;
    height: 40px;
    background-color: #333;
    top: -5px;
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

.ph-label {
    position: absolute;
    font-size: 0.8rem;
    top: -25px;
}

.ph-label.acid {
    left: 10%;
}

.ph-label.neutral {
    left: 50%;
    transform: translateX(-50%);
}

.ph-label.alkaline {
    right: 10%;
}

.ph-value {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 15px;
}

.color-info {
    display: flex;
    align-items: center;
    margin: 15px 0;
    justify-content: center;
    gap: 15px;
}

.color-box {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.result-text {
    text-align: center;
    line-height: 1.6;
    margin-top: 15px;
}

.reset-button {
    padding: 12px 24px;
    background-color: #6a8fd1;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

.reset-button:hover {
    background-color: #4a6fb5;
}

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.camera-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#camera-view {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
}

.camera-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

#capture-button, #close-camera {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

#capture-button {
    background-color: #e74c3c;
    color: white;
}

#close-camera {
    background-color: #333;
    color: white;
}

.sample-text {
    color: #666;
    margin: 5px 0;
    text-align: center;
}

.sample-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.sample-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.sample-thumb:hover {
    transform: scale(1.05);
    border-color: #6a8fd1;
}

#sample-button {
    display: none;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .custom-file-upload,
    #camera-button,
    #sample-button,
    .reset-button {
        width: 100%;
    }
}