/* Google Fonts Import in HTML head */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5; /* Light gray background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
    font-size: 16px;
}

.container {
    background-color: transparent; /* Main container itself is transparent */
    width: 95%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3em; /* Adjust as needed */
    font-weight: 700;
    color: #333;
    margin: 0;
}

.header .highlight {
    color: #007bff; /* Blue color for QR as in the image */
}

.main-content {
    display: flex;
    gap: 30px; /* Space between the two main columns */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 30px;
    flex-grow: 1; /* Allow cards to grow */
}

.generator-card {
    flex: 2; /* Generator card takes more space */
    min-width: 450px; /* Minimum width before wrapping */
}

.right-panel {
    flex: 1; /* Right panel takes less space */
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 300px; /* Minimum width before wrapping */
}

.qr-output-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px; /* Slightly less padding for QR output */
}

/* --- Input Options (Tabs) --- */
.input-options {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap */
    gap: 8px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e0e0e0; /* Separator line */
    padding-bottom: 15px;
}

.input-options button {
    background-color: #f8f9fa; /* Light background for inactive */
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 0.9em;
    font-weight: 600;
    color: #6c757d; /* Dark gray for inactive text */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 5px; /* Space between icon and text */
}

.input-options button svg {
    color: #999; /* Icon color for inactive */
    width: 18px;
    height: 18px;
}

.input-options button:hover {
    background-color: #e9ecef;
    color: #333;
}

.input-options button.active {
    background-color: #007bff; /* Primary blue for active */
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.input-options button.active svg {
    color: white; /* White icon for active */
}


/* --- Input Group (Label + Textarea/Select/Input) --- */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

/* --- Gilt für alle Arten von Inputs --- */
.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="tel"],
.input-group input[type="password"],
.input-group textarea {
    width: calc(100% - 24px); /* Full width minus padding */
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1em;
    resize: vertical;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    font-family: 'Poppins', sans-serif;
}

.input-group textarea {
     min-height: 100px; /* Consistent height for textarea */
}

.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus,
.input-group input[type="tel"]:focus,
.input-group input[type="password"]:focus,
.input-group textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* --- Container für Formular-Felder --- */
.form-fields-container {
    position: relative;
}

.form-fields {
    animation: fadeIn 0.3s ease-in-out;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


.charCount { 
    display: block;
    text-align: right;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
}

/* --- Grid-Layouts für VCard und WIFI --- */
.vcard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.wifi-options {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.wifi-options .input-group {
    flex: 1;
}

.hidden-network-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px; 
    padding-top: 10px; 
}
.hidden-network-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
    cursor: pointer;
}
.hidden-network-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}


/* --- Options Group (Image Size, Error Level) --- */
.options-group {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap; 
}

.option {
    flex: 1; 
    min-width: 150px;
}

.option label {
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
    margin-bottom: 8px;
    display: block; 
}

.option select,
.input-group select { 
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1em;
    background-color: white;
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    font-family: 'Poppins', sans-serif;
}

.option select:focus,
.input-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* --- Primary Button (Generate) --- */
.primary-button {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    display: flex; /* Für Icon + Text */
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-button:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

/* --- QR Code Display --- */
.qr-code-box {
    width: 250px; 
    height: 250px; 
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    margin: 10px auto 20px auto; 
    overflow: hidden; 
}

.qr-code-box img {
    max-width: 90%; 
    max-height: 90%;
    object-fit: contain;
}

/* --- Action Buttons (Download, Copy) --- */
.action-buttons {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
    justify-content: center; 
    width: 100%;
}

.action-buttons a,
.action-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none; 
}

.download-button {
    background-color: #28a745; 
    color: white;
}

.download-button:hover {
    background-color: #218838;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.copy-button {
    background-color: #6c757d; 
    color: white;
}

.copy-button:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}

.action-buttons svg {
    width: 18px;
    height: 18px;
    color: white;
}


/* --- ALTER Reader Section (WIRD VON index.html BENUTZT) --- */
.reader-card h2 {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.reader-instructions {
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.file-upload-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.hidden-file-input {
    display: none; 
}

.file-upload-label {
    background-color: #e9ecef; 
    color: #495057;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease-in-out;
    flex-shrink: 0; 
}

.file-upload-label svg {
    width: 20px;
    height: 20px;
}

.file-upload-label:hover {
    background-color: #dee2e6;
}

.file-name-display {
    color: #6c757d;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
    flex-grow: 1; 
}

.secondary-button {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #007bff; 
    border-radius: 8px;
    background-color: transparent;
    color: #007bff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.secondary-button:hover {
    background-color: #e7f3ff; 
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.decoded-output {
    min-height: 100px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.95em;
    color: #333;
    word-break: break-all; 
}

.decoded-output p {
    margin: 0;
    line-height: 1.5;
}

.decoded-output ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.decoded-output li {
    background-color: #ffffff;
    border: 1px solid #f0f0f0;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.decoded-output li:last-child {
    margin-bottom: 0;
}
.decoded-output li strong {
    color: #007bff;
}

/* --- Responsive adjustments --- */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    .generator-card, .right-panel {
        flex: none; 
        width: 100%;
        max-width: 600px; 
        min-width: unset; 
    }
    .header h1 {
        font-size: 2.5em;
    }
    .vcard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    .card {
        padding: 20px;
    }
    .header h1 {
        font-size: 2em;
    }
    .input-options button {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    .primary-button, .secondary-button {
        font-size: 0.9em;
        padding: 12px 15px;
    }
    .action-buttons a, .action-buttons button {
        font-size: 0.85em;
        padding: 8px 12px;
    }
    .wifi-options {
        flex-direction: column;
        align-items: stretch;
    }
    .hidden-network-group {
        justify-content: flex-start;
        padding-top: 0;
        margin-bottom: 25px;
    }
}

/* --- Nav-Link (barcode.html) --- */
.header {
    position: relative; 
}

.nav-link {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-color: #007bff;
    color: white !important; 
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.nav-link:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 1.8em;
    }
    .nav-link {
        position: static; 
        transform: none;
        display: block;
        width: calc(100% - 30px); 
        margin-top: 15px;
        text-align: center;
    }
}

/* --- NEUE STILE FÜR DEN NEUEN SCANNER (barcode.html) --- */
.scanner-container {
    width: 100%;
    margin-top: 30px;
    padding: 0; /* Entfernt das innere Padding der 'card', um vollen Platz zu nutzen */
    overflow: hidden; /* Stellt sicher, dass die Ecken rund bleiben */
}

.scanner-container h2 {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 20px 30px;
    background-color: #f8f9fa; /* Leichter Hintergrund für den Titel */
    border-bottom: 1px solid #e0e0e0;
}

.scanner-tabs {
    display: flex;
    background-color: #f8f9fa;
    padding: 0 30px; /* Passt zum 'card' padding */
}

.scanner-tab {
    flex: 1;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 15px 20px;
    font-size: 1em;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scanner-tab:hover {
    color: #007bff;
}

.scanner-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.scanner-body {
    display: flex;
    flex-wrap: wrap; /* Umbruch auf kleinen Bildschirmen */
    padding: 30px;
    background-color: #ffffff;
}

.scanner-left {
    flex: 1;
    min-width: 250px;
    padding-right: 30px; /* Abstand zur rechten Seite */
    border-right: 1px solid #e0e0e0; /* Trennlinie */
}

.scanner-dropzone {
    width: 100%;
    height: 180px;
    border: 2px dashed #007bff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    color: #6c757d;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 20px;
}

.scanner-dropzone:hover {
    background-color: #e7f3ff;
}

.scanner-dropzone p {
    font-weight: 600;
    color: #007bff;
    margin: 10px 0 5px 0;
}

.scanner-dropzone .file-name-display {
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
}

#uploadBarcodeBtn {
    width: 100%; /* Passt sich an .scanner-left an */
}

.privacy-note {
    font-size: 0.8em;
    color: #6c757d;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    margin-top: 20px;
}
.privacy-note strong {
    color: #555;
}

.scanner-right {
    flex: 1;
    min-width: 250px;
    padding-left: 30px; /* Abstand zur linken Seite */
    display: flex;
    justify-content: center;
    align-items: center;
}

.scanner-placeholder {
    text-align: center;
    color: #6c757d;
}

.scanner-illustration {
    max-width: 150px;
    height: auto;
    opacity: 0.7;
}

.scanner-status-text {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 15px;
}

/* Anpassungen für Ergebnisse im rechten Panel */
.scanner-right .decoded-output {
    width: 100%;
    min-height: 0;
    margin-top: 0; /* Überschreibt alte Reader-Stile */
}

@media (max-width: 768px) {
    .scanner-body {
        flex-direction: column;
    }
    .scanner-left {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 30px;
        margin-bottom: 30px;
    }
    .scanner-right {
        padding-left: 0;
    }
}