:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4895ef;
    --dark: #1b263b;
    --light: #f8f9fa;
    --success: #4cc9f0;
    --warning: #f72585;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    background: linear-gradient(to right, #4361ee, #3a0ca3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #6c757d;
    font-size: 1.1rem;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .app-container {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f3f5;
}

.card-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--primary);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.tab-buttons {
    display: flex;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f3f5;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.camera-container {
    width: 100%;
    height: 300px;
    background: #f1f3f5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

#canvas {
    display: none;
}

.upload-area {
    border: 2px dashed #adb5bd;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

#file-input {
    display: none;
}

.preview-container {
    position: relative;
    margin-bottom: 1rem;
    display: none;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: var(--warning);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background-color: #d3165a;
    transform: scale(1.1);
}

.result-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    word-break: break-all;
}

.qr-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #f1f3f5;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border 0.3s ease;
}

.qr-input:focus {
    outline: none;
    border-color: var(--primary);
}

.qr-display {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 1rem auto;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: 0.5rem;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
}

.btn-warning {
    background: var(--warning);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f3f5;
    color: #6c757d;
}