body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to the top */
    min-height: 100vh;
    margin: 0;
    padding: 30px 20px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 500px;
    text-align: center;
}

h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group select,
.form-group input[type="color"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group input[type="color"]:focus {
    outline: none;
    border-color: #007bff;
}

.form-group input[type="color"] {
    height: 48px; /* Match height of text/select inputs */
    padding: 0; /* Remove internal padding */
    border: none; /* No border for color picker */
    background: transparent; /* Transparent background */
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0; /* Remove extra margin */
}

#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    border: 1px solid #eee; /* Light border around QR code */
    padding: 10px;
    background-color: #fff;
    width: fit-content; /* Adjust width to content */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#qrcode canvas {
    display: block; /* Remove extra space below canvas */
}

#downloadQrCode {
    background-color: #ff8c00; /* Orange button color */
    color: #fff;
    border: none;
    padding: 14px 25px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

#downloadQrCode:hover {
    background-color: #e67e00; /* Darker orange on hover */
}

.footer-note {
    font-size: 14px;
    color: #888;
    margin-top: 30px;
}

.footer-note-small {
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
}

.footer-note-small a {
    color: #007bff;
    text-decoration: none;
}

.footer-note-small a:hover {
    text-decoration: underline;
}


.footer-note-small {
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
    /* Tambahkan ini untuk Flexbox, jika ingin lebih kontrol */
    display: flex; /* Aktifkan flexbox */
    align-items: center; /* Sejajarkan item secara vertikal di tengah */
    justify-content: center; /* Opsional: Sejajarkan item secara horizontal di tengah */
    gap: 4px; /* Tambahkan sedikit jarak antar elemen */
}

.footer-note-small a {
    color: #007bff;
    text-decoration: none;
}

.footer-note-small a:hover {
    text-decoration: underline;
}

/* Ini adalah cara yang paling sederhana untuk SVG di dalam teks */
.footer-note-small svg {
    vertical-align: middle; /* Penting: sejajarkan SVG di tengah vertikal */
    margin-bottom: 2px; /* Mungkin perlu sedikit penyesuaian visual, opsional */
}


/* Clear the default cross icon for text input in some browsers */
input[type="text"]::-ms-clear { display: none; }
input[type="text"]::-webkit-search-cancel-button { display: none; }
input[type="text"]::-webkit-search-decoration { display: none; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 30px 25px; /* Adjust padding for smaller screens */
    }

    h1 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input[type="text"],
    .form-group select,
    .form-group input[type="color"] {
        padding: 10px;
        font-size: 15px;
    }

    .form-row {
        flex-direction: column; /* Stack items vertically on small screens */
        gap: 15px; /* Adjust gap when stacked */
    }

    #qrcode {
        margin: 25px auto;
        padding: 8px; /* Slightly reduce padding around QR code */
    }

    #downloadQrCode {
        padding: 12px 20px;
        font-size: 16px;
    }

    .footer-note {
        font-size: 13px;
        margin-top: 25px;
    }

    .footer-note-small {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px 20px;
        margin: 20px auto; /* Add some margin from top/bottom for very small screens */
    }

    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    #qrcode {
        margin: 20px auto;
    }

    /* Ensure QR code itself doesn't overflow on very small screens */
    #qrcode canvas {
        max-width: 100%;
        height: auto;
    }
}

/* Optional: Adjust body alignment for smaller screens if content is shorter */
@media (max-height: 600px) and (max-width: 768px) {
    body {
        align-items: flex-start; /* Ensure content starts from top if height is constrained */
    }
}

/* QR Code Reader Specific Styles */
.reader-options {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.drag-drop-area {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f8faff;
    color: #555;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.drag-drop-area.highlight {
    background-color: #e6f7ff;
    border-color: #0056b3;
}

.drag-drop-area p {
    margin: 5px 0;
}

.drag-drop-area .upload-button {
    background-color: #007bff; /* Primary blue for select file */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.drag-drop-area .upload-button:hover {
    background-color: #0056b3;
}

#scanCameraButton {
    background-color: #28a745; /* Green button for camera */
    color: #fff;
    border: none;
    padding: 14px 25px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 300px;
}

#scanCameraButton:hover {
    background-color: #218838;
}

#stopCameraButton {
    background-color: #dc3545; /* Red button for stop camera */
}

#stopCameraButton:hover {
    background-color: #c82333;
}

.or-separator {
    position: relative;
    width: 100%;
    text-align: center;
    margin: 15px 0;
    color: #888;
    font-size: 14px;
}

.or-separator::before,
.or-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: #eee;
}

.or-separator::before {
    left: 0;
}

.or-separator::after {
    right: 0;
}

.result-area {
    text-align: center;
    background-color: #e9ecef;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    word-break: break-all; /* Break long text */
}

.result-area h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.scanned-text {
    font-size: 18px;
    font-weight: 600;
    color: #0056b3; /* Darker blue for result */
}

.back-button {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 20px;
    background-color: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    font-size: 16px;
}

.back-button:hover {
    background-color: #5a6268;
}

/* Responsive adjustments for Reader page */
@media (max-width: 480px) {
    .reader-options {
        gap: 15px;
    }

    .drag-drop-area {
        padding: 30px 15px;
    }

    .drag-drop-area p {
        font-size: 14px;
    }

    .drag-drop-area .upload-button,
    #scanCameraButton {
        padding: 10px 15px;
        font-size: 15px;
    }

    .result-area {
        padding: 15px;
    }

    .result-area h2 {
        font-size: 18px;
    }

    .scanned-text {
        font-size: 16px;
    }

    .back-button {
        font-size: 14px;
        padding: 8px 15px;
    }
}

/* Share Icon */
.share-icon-wrapper {
    position: absolute;
    top: 25px; /* Adjust as needed */
    right: 25px; /* Adjust as needed */
    cursor: pointer;
    background-color: #f0f2f5; /* Match body background or container if preferred */
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10; /* Ensure it's above other elements */
}

.share-icon-wrapper:hover {
    background-color: #e0e2e5;
    transform: scale(1.05);
}

.share-icon-wrapper svg {
    color: #555; /* Icon color */
    display: block; /* Remove extra space below SVG */
}

/* Share Modal */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent black overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's above everything */
    visibility: hidden; /* Hidden by default */
    opacity: 0; /* Faded out by default */
    transition: visibility 0.3s, opacity 0.3s ease;
    backdrop-filter: blur(5px); /* Blur effect for modern browsers */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
}

.share-modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.share-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(-20px); /* Initial state for animation */
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.share-modal-overlay.active .share-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.share-modal-content h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.share-modal-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #333;
}

.social-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Responsive grid */
    gap: 15px;
    justify-content: center;
}

.social-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid #eee;
}

.social-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.social-button svg {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

/* Specific Social Button Colors (for icons and hover background) */
.social-button.facebook { color: #3b5998; }
.social-button.facebook:hover { background-color: #3b5998; color: #fff; }
.social-button.facebook:hover svg { fill: #fff; }

.social-button.twitter { color: #000; } /* X is black */
.social-button.twitter:hover { background-color: #000; color: #fff; }
.social-button.twitter:hover svg { fill: #fff; }

.social-button.threads { color: #000; } /* Threads is black */
.social-button.threads:hover { background-color: #000; color: #fff; }
.social-button.threads:hover svg { fill: #fff; }

.social-button.instagram { color: #C13584; }
.social-button.instagram:hover { background-image: linear-gradient(to right, #833AB4, #FD1D1D, #FCAF45); color: #fff; }
.social-button.instagram:hover svg { fill: #fff; }

.social-button.linkedin { color: #0A66C2; }
.social-button.linkedin:hover { background-color: #0A66C2; color: #fff; }
.social-button.linkedin:hover svg { fill: #fff; }

.social-button.whatsapp { color: #25D366; }
.social-button.whatsapp:hover { background-color: #25D366; color: #fff; }
.social-button.whatsapp:hover svg { fill: #fff; }


/* Responsive adjustments for Share Modal */
@media (max-width: 550px) {
    .share-modal-content {
        padding: 20px;
        width: 95%; /* Make it wider on smaller screens */
    }

    .share-modal-content h2 {
        font-size: 20px;
    }

    .share-modal-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .social-share-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Adjust min-width for smaller buttons */
        gap: 10px;
    }

    .social-button {
        padding: 12px 8px;
        font-size: 13px;
    }

    .social-button svg {
        width: 28px;
        height: 28px;
        margin-bottom: 6px;
    }

    .share-icon-wrapper {
        top: 15px; /* Adjust position for smaller screens */
        right: 15px;
        padding: 6px;
        width: 36px;
        height: 36px;
    }
     .share-icon-wrapper svg {
        width: 20px;
        height: 20px;
    }
}

/* Barcode Generator Specific Styles */
.barcode-display {
    margin: 30px auto;
    border: 1px solid #eee;
    padding: 15px; /* Slightly more padding for barcode display */
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex; /* Use flex to center SVG */
    justify-content: center;
    align-items: center;
    width: fit-content; /* Adjust width to content */
    max-width: 100%; /* Ensure it doesn't overflow */
    overflow-x: auto; /* Allow horizontal scroll if barcode is too wide */
}

.barcode-display svg {
    display: block; /* Remove extra space below SVG */
    max-width: 100%; /* Ensure SVG fits within its container */
    height: auto; /* Maintain aspect ratio */
}

.form-group small {
    display: block;
    font-size: 13px;
    color: #777;
    margin-top: 5px;
}

/* Adjustments for multiple download buttons */
#downloadBarcode, #downloadBarcodePng {
    background-color: #ff8c00; /* Orange button color */
    color: #fff;
    border: none;
    padding: 14px 25px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

#downloadBarcode:hover, #downloadBarcodePng:hover {
    background-color: #e67e00; /* Darker orange on hover */
}

/* If you want them side by side on desktop, stacked on mobile */
@media (min-width: 600px) {
    #downloadBarcode {
        width: 48%; /* Adjust width for side-by-side */
        margin-right: 2%; /* Add some spacing */
    }
    #downloadBarcodePng {
        width: 48%;
        margin-left: 2%;
    }
}
@media (max-width: 599px) {
    #downloadBarcode, #downloadBarcodePng {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        margin-top: 15px; /* Adjust top margin for stacking */
    }
}

/* Barcode Reader Specific Styles */
.scanned-format {
    font-size: 14px;
    color: #777;
    margin-top: 10px;
    font-style: italic;
}

/* Make sure the multi-line navigation buttons look good on mobile */
@media (max-width: 550px) {
    .back-button {
        display: block; /* Stack buttons */
        width: 100%;
        margin-left: 0 !important; /* Override inline style */
        margin-top: 10px; /* Add space between stacked buttons */
    }
    /* First button might need adjusted top margin if it's the very first element after footer-note */
    .footer-note + .back-button {
        margin-top: 30px; /* More space above the first button after the footer note */
    }
}