:root {
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --background-color: #f5f5f5;
    --text-color: #1e293b;
    --error-color: #ef4444;
    --success-color: #22c55e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

.app-container {
    position: relative;
    height: 100vh;
    background-color: #000;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
}

#video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#frame-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    height: 95vh;
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
    object-fit: contain;
}

#preview-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    background-color: black;
    display: none;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    z-index: 20;
}

.control-button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    min-width: 120px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-button:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.control-button:disabled {
    background-color: rgba(200, 200, 200, 0.5);
    cursor: not-allowed;
    transform: none;
}

#capture-button {
    background-color: #4CAF50;
    color: white;
}

#confirm-button {
    background-color: #2196F3;
    color: white;
}

#retake-button {
    background-color: #f44336;
    color: white;
}

#download-button {
    background-color: #9C27B0;
    color: white;
}

.orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.orientation-warning i {
    font-size: 48px;
    margin-bottom: 20px;
    animation: rotate 2s infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    100% { transform: rotate(90deg); }
}

.frame-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 3;
    font-size: 16px;
    backdrop-filter: blur(5px);
}

.company-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    max-width: 150px;
    z-index: 3;
    opacity: 0.8;
}

.photos-section {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(10px);
    max-width: 300px;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.photo-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

.thank-you-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* Portrait mode detection */
@media (orientation: portrait) {
    .orientation-warning {
        display: flex;
    }
    
    .camera-container {
        display: none;
    }
}
