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

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

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Controls */
#controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: #2a2a2a;
    border-bottom: 2px solid #3a3a3a;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

label {
    font-size: 14px;
    font-weight: 500;
}

select {
    padding: 6px 12px;
    background: #3a3a3a;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    cursor: pointer;
}

input[type="range"] {
    width: 100px;
    cursor: pointer;
}

#opacity-value {
    min-width: 40px;
    font-size: 14px;
}

.btn {
    padding: 8px 16px;
    background: #3a3a3a;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:hover:not(:disabled) {
    background: #4a4a4a;
}

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

.btn-primary {
    background: #007bff;
    border-color: #0056b3;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Camera Container */
#camera-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    overflow: hidden;
}

#camera-feed {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}

#onion-skin-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    max-width: 100%;
    max-height: 100%;
}

#capture-overlay {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#capture-message {
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.btn-capture {
    font-size: 18px;
    padding: 12px 24px;
    background: #28a745;
    border-color: #1e7e34;
}

.btn-capture:hover {
    background: #1e7e34;
}

/* Timeline */
#timeline-container {
    background: #2a2a2a;
    border-top: 2px solid #3a3a3a;
    flex-shrink: 0;
    height: 180px;
    display: flex;
    flex-direction: column;
}

#timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #3a3a3a;
}

#timeline-header h3 {
    font-size: 16px;
    font-weight: 500;
}

#timeline {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
}

#timeline::-webkit-scrollbar {
    height: 8px;
}

#timeline::-webkit-scrollbar-track {
    background: #1a1a1a;
}

#timeline::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.frame-item {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border: 2px solid #4a4a4a;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.frame-item:hover {
    border-color: #007bff;
}

.frame-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame-number {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.frame-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: #ffffff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.frame-item:hover .frame-delete {
    opacity: 1;
}

.frame-delete:hover {
    background: rgba(200, 35, 51, 1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #1a1a1a;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.3s;
}

#progress-text {
    font-size: 16px;
    margin-top: 10px;
}
