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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #000;
    min-height: 100vh;
    color: #fff;
}

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

header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #00d9ff;
}

header p {
    color: #888;
}

header .subtitle {
    color: #00d9ff;
    font-size: 1.1rem;
}

.instructions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.instructions h3 {
    color: #00d9ff;
    margin-bottom: 15px;
    font-size: 1rem;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    color: #ccc;
    margin-bottom: 10px;
    line-height: 1.5;
}

.instructions li:last-child {
    color: #00d9ff;
    font-weight: 500;
}

main {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #00d9ff;
}

.form-group input[type="number"] {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: #00d9ff;
}

.image-upload {
    position: relative;
}

.image-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-area:hover {
    border-color: #00d9ff;
    background: rgba(0, 217, 255, 0.05);
}

.upload-icon {
    font-size: 2rem;
}

.preview-container {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
}

.btn-analyze {
    background: linear-gradient(135deg, #00d9ff 0%, #0066ff 100%);
    color: #fff;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-analyze:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.btn-analyze:disabled {
    background: #444;
    cursor: not-allowed;
}

.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.results-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #00d9ff;
}

.result-image-container {
    text-align: center;
    margin-bottom: 20px;
}

.result-image-container img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.measurements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.measurement-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.measurement-card.highlight {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.measurement-card h3 {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
}

.measurement-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.measurement-card .uncertainty {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #ff4444;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #666;
}

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

    main {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .measurements {
        grid-template-columns: 1fr;
    }
}
