body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    margin-bottom: env(safe-area-inset-bottom, 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.button {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: env(safe-area-inset-bottom, 20px);
    position: relative;
    z-index: 1;
}

.button:hover {
    background-color: #45a049;
}

#cameraView {
    display: none;
    width: 100%;
    height: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    background-color: #000;
    margin: 20px 0;
    position: relative;
}

#cameraView video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#captureButton {
    display: none;
    background-color: #2196F3;
}

#captureButton:hover {
    background-color: #0b7dda;
}

#cropContainer {
    display: none;
    width: 100%;
    max-width: 500px;
    margin: 20px 0;
    position: relative;
}

#cropImage {
    max-width: 100%;
    height: auto;
    display: block;
}

#resultContainer {
    display: none;
    width: 100%;
    max-width: 500px;
    margin: 20px 0;
    position: relative;
}

#resultImage {
    max-width: 100%;
    height: auto;
    display: block;
}

#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#uploadButton {
    display: none;
    background-color: #2196F3;
}

#uploadButton:hover {
    background-color: #0b7dda;
}

.nav-buttons {
    display: none;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.nav-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #2196F3;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    background-color: #0b7dda;
}

.nav-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.sets-count {
    display: none;
    text-align: center;
    font-size: 18px;
    margin-top: 20px;
    color: #333;
}

.cropper-container {
    max-width: 100%;
    margin: 0 auto;
}

.cropper-view-box {
    border-radius: 0;
}

.cropper-face {
    background-color: transparent;
}

.cropper-line {
    background-color: #fff;
}

.cropper-point {
    background-color: #fff;
    width: 10px;
    height: 10px;
}

.cropper-point.point-se {
    right: -5px;
    bottom: -5px;
}

.cropper-point.point-sw {
    left: -5px;
    bottom: -5px;
}

.cropper-point.point-ne {
    right: -5px;
    top: -5px;
}

.cropper-point.point-nw {
    left: -5px;
    top: -5px;
}

.cropper-point.point-n {
    top: -5px;
}

.cropper-point.point-s {
    bottom: -5px;
}

.cropper-point.point-e {
    right: -5px;
}

.cropper-point.point-w {
    left: -5px;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.expander-section {
    margin-top: 30px;
    width: 100%;
}

.expander {
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    background-color: white;
}

.expander-header {
    width: 100%;
    padding: 8px 10px;
    background-color: #fafafa;
    border: none;
    text-align: left;
    font-size: 13px;
    font-weight: normal;
    color: #666;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.expander-header:hover {
    background-color: #f5f5f5;
}

.expander-icon {
    transition: transform 0.3s;
    font-size: 10px;
}

.expander-header[aria-expanded="true"] .expander-icon {
    transform: rotate(-180deg);
}

.expander-content {
    display: none;
    overflow: hidden;
    padding: 0;
}

.expander-content.expanded {
    display: block;
    padding: 10px;
}

.expander-content p {
    margin: 0 0 8px 0;
    line-height: 1.4;
    text-align: left;
    font-size: 13px;
}

.expander-content p:last-child {
    margin-bottom: 0;
}

.expander-content a {
    color: #2196F3;
    text-decoration: none;
    font-size: 13px;
}

.expander-content a:hover {
    text-decoration: underline;
}

.example-image {
    width: 100%;
    max-width: 100%;
    max-height: 300px;
    height: auto;
    display: block;
    border-radius: 3px;
    object-fit: contain;
}
