/* Variables */
:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --text-color: #333;
    --light-gray: #f0f0f0;
    --border-color: #ddd;
    --error-color: #ea4335;
    --success-color: #34a853;
    --font-family: 'Roboto', Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.hidden {
    display: none !important;
}

/* En-tête et navigation */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin-left: auto;
}

.nav-menu li {
    margin-left: 1.5rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
}

.nav-menu a:hover {
    text-decoration: underline;
}

/* Contenu principal */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* Scanner */
.scanner-container {
    max-width: 600px;
    margin: 0 auto;
}

.scanner-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.scan-options {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.scanner-view {
    width: 100%;
    height: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    position: relative;
}

#preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background-color: var(--light-gray);
}

.scan-result {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.scan-result h2 {
    margin-bottom: 1rem;
}

#resultContent {
    background-color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    word-break: break-all;
    min-height: 60px;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Historique */
.history-container {
    max-width: 800px;
    margin: 0 auto;
}

.history-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.scan-filters {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.scan-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scan-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scan-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.scan-type {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.scan-date {
    color: #666;
}

.scan-data {
    font-size: 1rem;
    word-break: break-all;
}

.scan-actions {
    display: flex;
    justify-content: flex-end;
}

/* Détails du scan */
.scan-details {
    max-width: 800px;
    margin: 0 auto;
}

.scan-details h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.details-container {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 1rem;
}

.detail-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-weight: bold;
    width: 100px;
    flex-shrink: 0;
}

.content-box {
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: 4px;
    word-break: break-all;
}

/* Boutons et contrôles */
.select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    background-color: white;
}


/* Responsive */
@media (max-width: 768px) {
    .scan-options {
        flex-direction: column;
    }
    
    .nav-menu {
        margin-left: 1rem;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        margin-bottom: 0.5rem;
    }
}

/* PWA styles pour iOS */
@supports (-webkit-touch-callout: none) {
    .scanner-view {
        height: 0;
        padding-bottom: 56.25%; /* Ratio 16:9 */
        position: relative;
    }
    
    #preview {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}