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

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Screen management */
.screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80vh;
}

.screen.active {
    display: flex;
}

/* Fade-in animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-element {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-delayed-1s {
    animation-delay: 1s;
}

.fade-in-delayed-2s {
    animation-delay: 2s;
}

.fade-in-delayed-3s {
    animation-delay: 3s;
}

.fade-in-delayed-4s {
    animation-delay: 4s;
}

.content {
    width: 100%;
    max-width: 400px;
}

/* Typography */
h1, h2, h3 {
    font-weight: normal;
    margin-bottom: 1em;
}

.title {
    font-size: 3em;
    margin-bottom: 0.5em;
    letter-spacing: 2px;
}

.credo {
    font-size: 1.2em;
    margin: 2em;
    opacity: 0.8;
}

/* Buttons */
.btn {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 8px 16px;
    margin: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
    transition: all 0.2s;
}

.btn:hover:not(:disabled) {
    background: #fff;
    color: #000;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 1em;
}

/* Consent screen */
.permissions {
    text-align: left;
    margin: 2em 0;
}

.permission {
    display: flex;
    align-items: center;
    margin: 1.5em 0;
    cursor: pointer;
    min-height: 44px; /* Minimum touch target size for mobile */
    padding: 0.5em 0;
}

.permission input {
    margin-right: 15px;
    transform: scale(1.5); /* Make checkboxes larger for mobile */
    cursor: pointer;
}

.permission span {
    flex: 1;
    cursor: pointer;
}

.privacy-note {
    font-size: 0.9em;
    opacity: 0.7;
    margin: 2em 0;
}

.privacy-note a {
    color: #ccc;
    text-decoration: underline;
}

/* Main app screen */
#app-screen {
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding-top: 20px;
}

.status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #fff;
    margin-bottom: 20px;
    font-size: 0.9em;
}

#connection-status {
    color: #fff;
}

#connection-status.offline {
    color: #888;
}

/* Typewriter effect */
.prompt-area {
    margin: 2em 0;
    min-height: 100px;
    display: flex;
    align-items: flex-start;
}

.typewriter {
    flex: 1;
    line-height: 1.5;
    font-size: 1.1em;
}

.cursor {
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cursor {
        animation: none;
    }
    
    .fade-in-element {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
}

/* Proof results */
.proof-results {
    margin: 2em 0;
    border: 1px solid #fff;
    padding: 20px;
}

.proof-results h3 {
    margin-bottom: 1em;
    text-align: center;
}

.proof-status-list {
    text-align: left;
}

.proof-status-item {
    margin: 1em 0;
    padding: 1em;
    border: 1px solid #666;
    background: rgba(255, 255, 255, 0.05);
}

.proof-status-item.accepted {
    border-color: #4a9;
    background: rgba(68, 170, 153, 0.1);
}

.proof-status-item.rejected {
    border-color: #a44;
    background: rgba(170, 68, 68, 0.1);
}

.proof-status-item.pending {
    border-color: #aa4;
    background: rgba(170, 170, 68, 0.1);
}

.proof-status-header {
    font-weight: bold;
    margin-bottom: 0.5em;
}

.proof-status-reasoning {
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.4;
}

/* Proof widgets */
.proof-widgets {
    margin: 2em 0;
}

.widget {
    border: 1px solid #fff;
    padding: 20px;
    margin: 10px 0;
    text-align: center; /* Center all buttons in widgets */
}

.widget h3 {
    margin-bottom: 1em;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* GPS widget */
.gps-info, .audio-info {
    display: flex;
    justify-content: space-between;
    margin: 1em 0;
}

.metric {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.metric label {
    font-size: 0.9em;
    opacity: 0.7;
}

.metric span {
    font-size: 1.2em;
    margin-top: 0.2em;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 1em;
}

/* Camera widget */
.camera-area {
    text-align: center;
    margin: 1em 0;
}

#camera-input {
    display: none;
}

.camera-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.camera-btn:hover {
    background: #fff;
    color: #000;
}

.preview {
    margin-top: 1em;
}

.preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #fff;
}

/* Audio widget */
#waveform {
    border: 1px solid #fff;
    background: #000;
    width: 100%;
    height: 50px;
}

/* Error area */
.error-area {
    border: 1px solid #888;
    padding: 20px;
    margin: 1em 0;
    color: #888;
    text-align: center;
}

.error-text {
    margin-bottom: 1em;
}

/* Responsive design */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .title {
        font-size: 2em;
    }

    .gps-info, .audio-info {
        flex-direction: column;
        gap: 10px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        margin: 2px 0;
    }
}

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

    .btn {
        border-color: #fff;
        color: #fff;
    }

    .btn:hover:not(:disabled) {
        background: #fff;
        color: #000;
    }

    .status-line {
        border-color: #fff;
    }

    .widget {
        border-color: #fff;
    }
}

/* Status Overlays */
.status-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.status-screen {
    display: none; /* Hidden by default, shown by JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 400px;
}

.status-overlay .status-screen.active {
    display: flex;
}

.status-icon {
    font-size: 4em;
    margin-bottom: 0.5em;
}

#success-screen .status-icon {
    color: #4a9;
}

#rejection-screen .status-icon {
    color: #a44;
}

#rejection-screen h3 {
    margin-bottom: 0.5em;
}

#rejection-reason {
    font-size: 1.1em;
    margin-bottom: 0.5em;
    color: #fff;
}

#rejection-instruction {
    font-size: 1em;
    color: #ccc;
    margin-bottom: 1.5em;
}

/* Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1em;
}

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