/* === Kontainer Utama & Layout Form === */
.main-container {
    display: flex;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    align-items: flex-start;
    padding: 110px 40px 40px 40px;
}

.form-container {
    flex: 0 0 450px;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.preview-container {
    flex: 1 1 auto;
    top: 110px;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    min-width: 0;
}

/* === Header di Dalam Konten Form === */
.form-header,
.preview-header {
    text-align: center;
    margin-bottom: 30px;
}

.preview-header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.reload-btn {
    font-size: 12px;
    padding: 5px 10px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reload-btn:hover {
    background-color: #5a6268;
}

/* === Grup Form & Input === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box;
}

fieldset {
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

legend {
    font-weight: 600;
    font-size: 1.1em;
    padding: 0 10px;
    color: #1a4f6d;
}

/* === Tombol Submit & Efek Loading === */
.submit-btn {
    position: relative;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background-color: #1a4f6d;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #0d2c3f;
    transform: translateY(-2px);
}

.submit-btn .btn-text {
    transition: opacity 0.2s ease-in-out;
}

.submit-btn .loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    display: none;
    animation: spin 1s linear infinite;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .loader {
    display: block;
}

.submit-btn.loading {
    cursor: wait;
    background-color: #0d2c3f;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Elemen Lainnya === */
.info-box {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #1a4f6d;
    border-radius: 8px;
}

.notification {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* === Tabel Pratinjau === */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    text-align: left;
    font-size: 14px;
}

thead th {
    font-weight: 600;
    position: sticky;
    top: 0;
    background-color: #e9ecef;
    z-index: 10;
    white-space: nowrap;
}

/* === Aturan Responsif untuk Mobile === */
@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
        padding: 90px 20px 20px 20px;
        gap: 20px;
    }

    .form-container,
    .preview-container {
        flex: 1 1 100%;
        width: 100%;
        padding: 30px;
        position: static;
    }

    h1 {
        font-size: 24px;
    }
}