:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #f94144;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.app-container {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background-color: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.app-header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-main {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.camera-container {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.camera-view {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background-color: black;
}

.camera-view video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.focus-circle {
    width: 70%;
    height: 70%;
    border: 2px dashed rgba(255,255,255,0.5);
    border-radius: 50%;
}

.camera-controls {
    display: flex;
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #eee;
}

.camera-select {
    flex: 1;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-right: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.btn-icon.small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    background-color: var(--secondary-color);
}

/* Image Preview Styles */
.image-preview-container {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.image-preview-container h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.preview-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.uploaded-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

.no-preview {
    text-align: center;
    color: #aaa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.no-preview i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.no-preview p {
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn {
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Result Container */
.result-container {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.severity-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.severity-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    background-color: #eee;
}

.severity-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.severity-scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.scale-color {
    width: 100%;
    height: 8px;
    border-radius: 4px;
}

.extremely-mild { background-color: #a5d6a7; }
.mild { background-color: #81c784; }
.moderate { background-color: #fff176; }
.severe { background-color: #ef9a9a; }

/* Active state for scale items */
.scale-item.active .scale-color {
    height: 12px;
    margin-top: -2px;
}

.disclaimer {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
}

.disclaimer i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Hidden Elements */
canvas {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.25rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .severity-scale {
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-wrapper {
        height: 150px;
    }
}