/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* High contrast for outdoor readability */
.container {
    max-width: 100%;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.2rem;
    color: #ffffff;
    text-shadow: 0 0 10px #00ff00;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    color: #ccc;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Step system */
.step {
    display: none;
    flex-direction: column;
    gap: 15px;
    animation: stepFadeIn 0.3s ease-out;
}

.step.active {
    display: flex;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step indicator */
.step-indicator {
    text-align: center;
    font-size: 0.9rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.step-indicator.hidden {
    display: none;
}

/* Step instruction text */
.step-instruction {
    font-size: 1.1rem;
    color: #ccc;
    text-align: center;
    padding: 10px 0;
}

/* Completed step pills */
.completed-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.completed-steps:empty {
    display: none;
}

.step-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    animation: pillSlideIn 0.25s ease-out;
}

.pill-label {
    color: #ffffff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pill-value {
    color: #00ff00;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    flex: 1;
}

.pill-edit {
    background: none;
    border: 1px solid #555;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pill-edit:hover {
    border-color: #00ff00;
    color: #00ff00;
}

@keyframes pillSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input section */
.input-section {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #333;
}

.input-section label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #00ff00;
}

.input-section input {
    width: 100%;
    padding: 15px;
    font-size: 1.3rem;
    background: #000;
    color: #fff;
    border: 2px solid #00ff00;
    border-radius: 8px;
    text-align: center;
}

.input-section input:focus {
    outline: none;
    box-shadow: 0 0 15px #00ff00;
}

/* Camera viewfinder */
.viewfinder {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #00ff00;
    background: #000;
}

.viewfinder.hidden {
    display: none;
}

.viewfinder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crosshair-h,
.crosshair-v {
    position: absolute;
    background: rgba(0, 255, 0, 0.5);
}

.crosshair-h {
    top: 50%;
    left: 25%;
    right: 25%;
    height: 1px;
}

.crosshair-v {
    left: 50%;
    top: 25%;
    bottom: 25%;
    width: 1px;
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px #00ff00;
}

.angle-overlay {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px #000, 0 0 10px #00ffff;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

/* Fallback angle display (no camera) */
.angle-display {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #333;
    text-align: center;
}

.angle-display.hidden {
    display: none;
}

#live-angle-fallback {
    font-size: 2.5rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    font-family: 'Courier New', monospace;
}

/* Buttons */
.primary-btn {
    background: #ff6600;
    color: #fff;
    border: none;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #ff6600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn:hover {
    background: #ff8800;
    border-color: #ff8800;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    background: #666;
    border-color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

/* Status and result displays */
.status-message {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #333;
    text-align: center;
    font-size: 1.1rem;
    color: #ffff00;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-message:empty {
    display: none;
}

.result-display {
    background: #0d5016;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #00ff00;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive design for larger screens */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
        padding: 40px 20px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: #000;
    }

    .primary-btn {
        border-width: 3px;
    }

    .input-section input {
        border-width: 3px;
    }
}
