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

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

#app {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Error messages */
.error-message {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    background-color: #ff4444;
    color: white;
    padding: 15px;
    border-radius: 8px;
    z-index: 1000;
    font-size: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

/* Camera view */
.camera-view {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #222;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Capture button */
.capture-btn {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
    z-index: 10;
}

.capture-btn:hover {
    background-color: #f0f0f0;
    transform: translateX(-50%) scale(1.05);
}

.capture-btn:focus {
    outline: 3px solid #007AFF;
    outline-offset: 2px;
}

.capture-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.capture-btn span {
    font-size: 24px;
}

/* Preview view */
.preview-view {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #000;
}

#preview-image {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #222;
}

/* Preview actions */
.preview-actions {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 10;
}

.action-btn {
    background-color: #fff;
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.action-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}

.action-btn:focus {
    outline: 3px solid #007AFF;
    outline-offset: 2px;
}

.action-btn:active {
    transform: scale(0.95);
}

.retake-btn {
    background-color: #666;
    color: #fff;
}

.retake-btn:hover {
    background-color: #555;
}

.send-btn {
    background-color: #007AFF;
    color: #fff;
}

.send-btn:hover {
    background-color: #0056CC;
}

.send-btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.send-btn:disabled:hover {
    background-color: #ccc;
    transform: none;
}

/* Status messages */
.status-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    z-index: 1000;
    font-size: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.status-message.success {
    background-color: rgba(34, 197, 94, 0.9);
}

.status-message.error {
    background-color: rgba(239, 68, 68, 0.9);
}

/* Debug footer */
.debug-footer {
    position: absolute;
    bottom: 20px;
    left: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ccc;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    display: flex;
    justify-content: space-between;
    backdrop-filter: blur(5px);
    z-index: 5;
}

.debug-footer div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 45%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .capture-btn {
        bottom: 15px;
        padding: 12px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .preview-actions {
        bottom: 15px;
        gap: 12px;
    }
    
    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .debug-footer {
        bottom: 70px;
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .capture-btn,
    .action-btn {
        transition: none;
    }
    
    .capture-btn:hover,
    .action-btn:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .capture-btn,
    .action-btn {
        border: 2px solid #000;
    }
    
    .error-message {
        border: 2px solid #fff;
    }
}

