/* Mobile-first responsive design */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 600px;
    width: 100%;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background-color: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 1.5rem;
}

main {
    padding: 20px;
}

#scanner-container {
    margin-bottom: 20px;
}

#reader {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    max-height: 300px;
}

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

button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#upload-section {
    margin-bottom: 20px;
}

.upload-label {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

#file-input {
    display: none;
}

.upload-label span {
    display: inline-block;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

#drop-area {
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    color: #666;
    transition: border-color 0.3s;
}

#drop-area.dragover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

#result-section {
    text-align: center;
}

#qr-result {
    margin: 20px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
}

footer {
    background-color: #f8f9fa;
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
}

/* Dark mode */
body.dark {
    background-color: #333;
    color: #f4f4f4;
}

body.dark .container {
    background-color: #444;
    color: #f4f4f4;
}

body.dark header {
    background-color: #0056b3;
}

body.dark #reader {
    border-color: #666;
}

body.dark #drop-area {
    border-color: #666;
    color: #ccc;
}

body.dark #drop-area.dragover {
    border-color: #007bff;
    background-color: #555;
}

body.dark #qr-result {
    border-color: #666;
    background-color: #555;
}

body.dark footer {
    background-color: #555;
}

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

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.modal h2 {
    color: green;
    margin-bottom: 15px;
}

.modal p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.modal button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal button:hover {
    background-color: #0056b3;
}

body.dark .modal-content {
    background-color: #444;
    color: #f4f4f4;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .controls {
        flex-direction: row;
    }
    
    #reader {
        max-width: 500px;
    }
}

/* Mobile specific */
@media (max-width: 768px) {
    #reader {
        max-height: 400px;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
}