/* Reset dan Base Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}


/* Header Styles */

header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}


/* Layout Styles */

.app-container {
    display: flex;
    flex-wrap: wrap;
    padding: 25px;
    gap: 25px;
}

.left-panel {
    flex: 1;
    min-width: 350px;
    padding: 25px;
    background: linear-gradient(to bottom right, #f8f9fa, #e9ecef);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.right-panel {
    flex: 2;
    min-width: 500px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* Panel Title */

.panel-title {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title i {
    display: flex;
    align-items: center;
}


/* Upload Section */

.upload-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-button {
    background: #3498db;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-input-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.file-name {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid #3498db;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* Preview Container */

.preview-container {
    width: 100%;
    height: 300px;
    background-color: #ffffff;
    border-radius: 8px;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 15px;
    position: relative;
}

.preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-placeholder {
    color: #7f8c8d;
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.preview-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.preview-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.preview-btn:hover {
    background: #2980b9;
}

.preview-btn.reset {
    background: #95a5a6;
}

.preview-btn.reset:hover {
    background: #7f8c8d;
}


/* Buttons */

.buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}

button {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-width: 150px;
}

.generate-btn {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.generate-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-btn {
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: white;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.download-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Control Groups */

.control-group {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.control-group h3 {
    margin-top: 0;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.control-label {
    min-width: 120px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: #dfe6e9;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.control-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}


/* Preview Overlay */

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}


/* QR Preview Box */

.qr-preview-box {
    position: absolute;
    border: 2px solid #3498db;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}


/* Text Preview */

.text-preview-box {
    position: absolute;
    background-color: white;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    overflow: hidden;
}

.text-preview-content {
    color: #000;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.kode-preview {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.nama-preview {
    font-size: 14px;
    margin-bottom: 3px;
    color: #333;
}

.asal-preview {
    font-size: 12px;
    color: #666;
    font-style: italic;
}


/* Toggle Preview */

.toggle-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

.toggle-preview input {
    margin: 0;
}

.toggle-preview label {
    margin: 0;
    font-size: 0.95rem;
    cursor: pointer;
}


/* Data Preview */

.data-preview {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.data-preview-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-preview-body {
    max-height: 400px;
    overflow-y: auto;
}


/* Table Styles */

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
}

td {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

tbody tr:hover {
    background-color: #f8f9fa;
}


/* Progress Container */

.progress-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
}


/* Status Container */

.status-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-value {
    color: #34495e;
    font-weight: 600;
}


/* Footer */

footer {
    text-align: center;
    padding: 25px;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #ecf0f1;
    margin-top: 20px;
}


/* Icon Styles */

.icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}


/* JSON Preview */

.json-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
    border-left: 4px solid #3498db;
}

.json-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* Resolution Controls */

.resolution-controls {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.resolution-controls h3 {
    margin-top: 0;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resolution-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.resolution-btn {
    padding: 8px 15px;
    background: #e9ecef;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s;
}

.resolution-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.resolution-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}


/* Block Container */

.block-container {
    position: absolute;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.qr-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #e0e0e0;
}

.info-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
}


/* Design Controls */

.design-controls {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.design-controls h3 {
    margin-top: 0;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Spacing Controls */

.spacing-controls {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.spacing-controls h3 {
    margin-top: 0;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Responsive Design */

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .left-panel,
    .right-panel {
        width: 100%;
    }
    button {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }
    header h1 {
        font-size: 2rem;
    }
    .buttons {
        flex-direction: column;
    }
    button {
        width: 100%;
    }
    .control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    input[type="range"] {
        width: 100%;
    }
}